Skip to main content

Drupal 8 Now: Writing Drupal 7 code with an eye towards Drupal 8

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.

by lee.rowlands /

The posts

Over the coming weeks we'll post the following Drupal 8 Now articles:

  • Part 1 - PSR-0 in Drupal 7In this article I'll present how you can start using PSR-0 namespaced code in your Drupal 7 modules
  • Part 2 - Object Oriented Page callbacks in Drupal 7In this article @xtfer will demonstrate using object oriented controllers in Drupal 7 for page callbacks.
  • Part 3 - Object Oriented plugins in Drupal 7In this article I'll present object-oriented plugins for Drupal 7
  • Part 4 - Composer dependencies in Drupal 7In this article @kim.pepper will demonstrate how to use composer dependencies in Drupal 7, using the Guzzle library (as used in Drupal 8) as an example.
  • Part 5 - PHPUnit tests in Drupal 7In this article I'll present a technique for adding unit-tests in Drupal 7
  • Part 6 - Injecting database connectionsIn this article I'll present a technique for injecting the active database connection into your object-oriented Drupal 7 code allowing you to write decoupled code, ready for porting to Drupal 8's architecture.

 

We hope you enjoy this series as much as our Drupal 8 ready series.