Adding Arguments And Options To Deployer Tasks

15th November 2020

I have been adding to my custom Deployer scripts for a number of months and I have now been using it to do more than just deploy my sites. Since it acts as a connection to my website server I have been using Deployer to perform other tasks like creating backups and clearing Drupal caches without having to log into the server to do it.

Creating A Game With PHP Part 2: Tic Tac Toe

9th November 2020

Following on from my last post about creating a command line game in PHP we now have a mechanism to listen to keypresses. The next step from here is to create a simple game. After thinking about a game that would fit into the command line I decided that something simple like tic tac toe (also called noughts and crosses) would be a good starting point. The game board is small and the conditions for winning are pretty simple to understand.

Creating A Game With PHP Part 1: Detecting Key Input

8th November 2020

I was watching a documentary about old computers on YouTube recently and it showed a video of an early computer game creating using the command line. This wasn't a text based adventure game, but a game creating using text for the graphics running as a program on the command line. This got me thinking that creating something like this should be possible using PHP. If it was possible on a 30 year old computer then surely it's possible to get PHP to do it, right? I thought it might be interesting to create a series of posts showing how to put this together.

Drupal 8: Creating A Subquery In Views

7th November 2020

You've probably been there before. A Drupal View you are working on looks great and has all the data and fields you need, but when you look a little closer at the results you realise that something is off. After looking at the generated SQL query you see that there is a problem with one of the joins which causes your counts to be off a little. Ultimately, you need to remove this join, but you really need that data included in your results.

Creating a subquery can allow you to pull out data from a specific field without adding another join that would cause the results to be out.

Drupal 9: Creating Custom Twig Functions And Filters

1st November 2020

Whilst Twig is a powerful tool in its own right there are occasions when you need to pull out data from Drupal or manipulate it in certain ways. I normally do this using preprocess steps, but I recently found that it was also possible to extend Twig within the Drupal framework to provide your own functions and filters. This can be useful if you have custom templates and need to perform special actions on data items to format them in different ways.

New Features And Breaking Changes PHP8

29th October 2020

PHP8 will be released on November 26th 2020 and there is lots being written about the upcoming features in this release. As this is a major version there will be new features as well as breaking changes so it's important to be aware of what is changing. This will make it easier to think about how PHP8 will effect your applications and what actions you will need to take to ensure you can upgrade without incident.

I thought I would go through a few of the main changes to see whats going to be in the next PHP release.

Drupal 9: Getting Setup Quickly With DrupalVM

11th October 2020

I like working with DrupalVM and I've worked with Ansible based Vagrant setups for years and so I'm very familiar with it's setup. More than that, I find I have very few problems with running it. I normally run it with Vagrant, but you can run it with Docker if you like.

Drupal 9: 7 Composer Tips

1st October 2020

I've been using composer with Drupal for a few years now and I've picked up a few things along the way that have really helped me out. Following on from my post about the anatomy of the recommended Drupal 9 composer file I thought it would be good to expand on that to present some tips.

Here are 7 tips that will help you out when using composer with Drupal.