Skip to main content

Drupal and Symfony 2

Back-end Development
Drupal

We here at Rapid Development Group are first and foremost Drupal developers, and have become the "go-to" people for anything related to the popular CMS. A large chunk of our work is in some form or another related to a Drupal site (even if it is an iOS app that connects to a Drupal backend).

Outside of this I have always been interested in other development frameworks, especially ones that implement the traditional MVC architecture, and have ORM configuration all within code that is easily versioned and deployed.  These kinds of framework allow for quick application development when the weight of CMS functionality isn't needed.  

Something that Ruby on Rails has become so popular for providing.

Years ago, Cake was the hotness that brought this (RoR) type functionality to the PHP world, and as PHP has evolved and become more object-oriented more frameworks have popped up. In the past year I gained more interest in these frameworks especially as it relates to the new versions of PHP.

PHP 5 introduced classes and a few other OOP structures, and by version 5.3 has become very refined in handling the whole suite of OOP structures (polymorphism, inheritance, etc). The problem with many PHP frameworks is that they catered to those using older versions of PHP to reach a wider audience. But as PHP 5.3 has become adopted there are frameworks being created that require it, which means they are lighter in weight, faster, and more efficient because they do not include all of the logic to make them backward compatible.

So I began researching these, and while there were a number of options, the one that seemed to stand out the most was Yii.  This had great documentation, and a strong community of developers backing it.  It's performance stats were superior to most others, and it is very flexible.  At this time Symfony 2 existed, but was still in beta.  Symfony 1 had been a success, but like many other frameworks adapted older versions of PHP. So while Symfony looked like a good option, I chose to pursue Yii because of it's current stability.

Fast forward a few months and Drupal announces a partnership with Symfony, and symfony 2 is fully released.  I was knee deep in Yii, but if symfony was ready to go it deserved another look, but more importantly, Symfony was going to be a part of the Drupal realm of which we are happily entrenched.  

So I made the decision to leave Yii and begin studying and learning the ins and outs of symfony. At this point I didn't know how much Drupal was going to include the symfony architecture.  The more I worked and played with Symfony the more I realized how clean, and powerful it is to use.  I was... dare I say... falling in love?

Now I am at Drupalcon Denver, and I am able to get a glimpse into the vision for the Drupal roadmap, especially as it relates to the next version of Drupal, (Drupal 8, which at this time is expected to release in spring/summer of 2013).  There are some primary objectives for the next release and Symfony fits many of those like a glove.

At a high level drupal 8 will be moving to a "Blocks Everywhere" layout approach.  A page layout will consist of "blocks", and blocks will contain other "blocks".  I put blocks in quotes since these really are not like the blocks structure drupal currently uses. For each of these blocks, a REST url will provide the contents.  This is a huge win for caching because only the block that is changing will need to refresh.  

This goes hand in hand with another initiative... to use reverse proxy, which is needed to execute this "Blocks Everywhere" approach.  

And lastly, there is a slow migration to a more object oriented code base, and this will continue in Drupal 8.  Contributed modules like Views, Beans, Migrate, etc. have already made this jump in their latest code releases.  

These initiatives for Drupal 8 have been established in Symfony, so rather than rewrite this infrastructure why not partner with a framework that has executed these principles better than anyone else. I hope to elaborate more on the initiatives of Drupal 8 as well as the main themes of DrupalCon Denver. What adds to the "synergy" is that Fabien Potencier, the creator of Symfony, is also excited about this partnership and will be working with the Drupal team to integrate his amazing framework with what we consider to be the best CMS.

For more information on this partnership, there are other more legitimate articles to read, from the creators themselves...

I'll stick to commentary and other trends I'm seeing within the Drupal network.

Need a fresh perspective on a tough project?

Let’s talk about how RDG can help.

Contact Us