I recently spoke at the Drupal Melbourne meetup about running Puppet and Docker to improve isolation when running multiple sites on the one host. It's alot of work to get setup properly for a remote speaker so I would like to thank the organisers for allowing me to present.

In Drupal we use object-oriented page and form callbacks to ease our programmning burden This is a nice improvement that allows us to encapsulate the functionality of one or many page callbacks into objects, with all the benefits that brings. Is it possible for us to us object-oriented page callbacks in Drupal 7? With a few tricks, yes it is. This article shows you how.

This is part of a continuing series of using Drupal 8 programming techniques in Drupal 7.

Drupal 8 embraces modern PHP with all the trimmings, shedding the baggage of supporting earlier PHP versions and embracing the new object-oriented features.

One such feature is namespaced objects and the PSR-0 standard for autoloader compatability.

But if you know your project will run on a recent version of PHP, there's no reason you can't write your custom modules using PSR-0 now, in Drupal 7

We're getting closer to that difficult stage. You know, that point where we're nearing a new major Drupal release. That point where customers with flexible delivery dates who are thinking about starting a new project are asking if they should wait for Drupal 8 to come out or build on Drupal 7.

Those of us who went through the Drupal 6 and Drupal 7 release know what I'm talking about. Do I build it on Drupal 6 or do I chance it on Drupal 7 and work through any missing modules.

We're not there yet for Drupal 8, but we already have customers asking us to develop Drupal 7 sites in a fashion sympathetic to Drupal 8.

So what does that mean? Well we have a few pointers on starting new Drupal 7 modules that will be easier to upgrade to Drupal 8 when the time comes. We'll present these in a new Drupal 8 Now! series of blog posts.

On Saturday morning at DrupalSouth, Kim Pepper and I presented Everything you wanted to know about Drupal 8 but were too afraid to ask.

We've been asked to present it again online for Jam's Drupal Camp but in the meantime, here's the slides

Pages

Subscribe to PreviousNext Blog Subscribe to PreviousNext Blog