Last weekend I attended DrupalCamp Spain at the beautiful Centro Cultural Bancaja, in Valencia, Spain. Three whole days of Drupal. This was my first Drupal conference, and… wow! The Drupal community is huge and full of passionate developers eager to learn. ServerGrove was one of the bronze sponsors and consolidates its support for the Drupal community. I was there because I was invited to give a talk about the Symfony components that are being used to create the new version of Drupal (Drupal 8). I got some great feedback from the attendees and I am excited to have the opportunity to participate the Drupal community.
Symfony in Drupal 8
In my talk I pointed out some of the problems of the current version of Drupal, which is mature, robust, and highly extensible, however, it lacks some of the recommended best practices for software engineering. This makes it harder to maintain and find new contributors. I borrowed one of the examples from Anthony Ferrara‘s talk on “Development, by the numbers”, which discusses some metrics of the drupal_http_request() function in Drupal 7, such as the cyclomatic and NPath complexity, and shows that it really needs a refactor, or in that case, use an HTTP abstraction component like HttpFoundation.
Fortunately the (still work in progress) 8th version of Drupal, 50% of its external dependencies are Symfony components, and others such as Twig, Assetic of Symfony CMF come also from the Symfony world.
In the talk I explained nine components being used by Drupal 8:
- HttpFoundation: Abstraction of the HTTP protocol (more info).
- HttpKernel: Defines an abstract process to convert a Request object into a Response object (more info).
- ClassLoader: Class autoload using MapClass or PSR-0 strategies.
- Routing: Drupal 8 uses CMF/Routing, which extends from the Routing component providing the flexibility needed by a CMS (more info).
- EventDispatcher: Alternative to the classic Drupal hooks. Implements the Mediator Pattern (more info).
- DependencyInjection: Implements a dependency injection container to centralize the object construction.
- Validator: Provides validation tools for values or objects (more info).
- Serializer: Serializes PHP objects into different formats (JSON, XML…), as wel as in the other way.
- Yaml: Loads and dumps data in YAML format. A useful format for configuration files written by humans.
Slides are only available in Spanish, but they will be translated to English too as soon as possible. If you understand Spanish, check them out: http://www.slideshare.net/raulfraile/symfony-en-drupal-8-drupalcamp-spain.
It was a great opportunity for me to learn different approaches for common problems from a different community. I am used to attend PHP and Symfony events, but as I said before, this was my first time ever in a Drupal conference. The talks I liked most were:
- WTF! Huge errors in projects told by their own authors: This talk was hilarious. 5 experienced Drupal developers told their unspeakable errors as beginners, such as not using a CVS and losing all the work the night before the deadline.
- Sockets to the limit: The talk went over an interesting use-case to have a centralised server to manage Symfony translations, and using websockets to “install” them in any server.
Just a photo to see how awesome this community is…
BTW, can you find Waldo? :)
For the second time in a row, ServerGrove proudly sponsored the most important Drupal conference in Spain. We are really happy to be a small part of this great event and hopefully we will keep collaborating in the future. If you attended the conference, remember that we have a couple of coupons for you: “DPSpain15″ for a 15% monthly discount in VPS from VPS 100 to 700, and “DPSpain20″ for a 20% yearly discount in VPS also ranging from VPS 100 to VPS 700. Take a look at our VPS plans.