Skip to main content
Start of main content.

Our blog

Welcome to our growing knowledge base.

Linking to revisionable files in Drupal 7

Our client had some very specific requirements for their project. They needed to be able to insert links to files and they needed to keep the same URL for those files even if the file changed. Those familiar with Drupal will know that by default, Drupal will suffix the newer version of the filename with _0, _1 etc which obviously breaks the URL. Here's how we worked around the issue...

Senior Developer

Drupal 8 Now: Composer dependencies in Drupal 7

One of the key goals of namespaces in PHP is to avoid collisions between class and function names between different libraries. Using namespaces and the PSR-0/4 standard creates a clean and simple way of sharing code across projects. This is a core part of the Drupal 8 architecture.

This approach has been a large factor in the PHP Renaissance and the huge amount of sharing of code across PHP external libraries.

In this post, I will show how we can leverage external libraries in existing Drupal 7 sites, using similar techniques to how it is being done in Drupal 8.

Upgrade array syntax the automatic way

This post covers upgrading from using the old array syntax to php 5.4 short array syntax using an automatic tool built with Pharborist. Phaborist is a PHP library to query and transform PHP source code via abstract syntax tree operations.  The result is more robust and shorter then the alternative of using tokens from token_get_all.

Senior Drupal Developer

A DOM for PHP

PHP provides the function token_get_all() for working with PHP source code, however it is too low level and requires a lot of work to extract information about the source code. In this article, it shows why token_get_all() is inadequate and introduces a higher level approach using Pharborist to working with source code.

Senior Drupal Developer