Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Symfony Components in the Wild Drupal Jungle

Symfony Components in the Wild Drupal Jungle

The talk seeks to provide a clear view on how Drupal is using Symfony Components. The focus would be on the state of things and how Symfony is providing a Backwards compatibility promise for other projects to ensure Drupal uses it rightly and follow upgrades of these components closely and keeping robust because of BC.

I am part of the symfony community and have been working with Symfony in industry and in the Open Source arena. I am also the maintainer of a tool called Gush which plans to revolutionize the speed in which we develop today, a game changer as someone says.

I will provide ways in which Drupal can reutilize further Symfony Components yet keeping the codebase well decoupled.

Everyone is invited to benefit from clear examples on how to help develop a clean Drupal codebase and understanding more the Symfony alien phenomena.

I am submitting because someone invited me to submit. :)

cordoval

June 05, 2014
Tweet

More Decks by cordoval

Other Decks in Programming

Transcript

  1. Welcome to my talk “I praise you, for I am

    fearfully and wonderfully made. Wonderful are your works; my soul knows it very well.” ! - Proverbs 139:14
  2. "## symfony $ "## class-loader $ "## debug $ "##

    dependency-injection $ "## event-dispatcher $ "## http-foundation $ "## http-kernel $ "## process $ "## property-access $ "## routing $ "## serializer $ "## translation $ "## validator $ &## yaml cd 8.x/core/vendor; tree -L 2 config? filesystem? expression- language?
  3. // austin.yml food: [tacos, burritos, fajitas] ! ! // menu.php

    use Symfony\Component\Yaml\Yaml; ! $options = Yaml::parse(‘austin.yml’); ! ... !
  4. Feature: Support Object Map ! Inline::parse( $value, // input false,

    // invalid exception false, // object support true // map to stdClass );
  5. [{ foo: {bar: foo} }] ! [ (object) [ ‘foo’

    => (object) [ ‘bar’ => ‘foo’ ] ] ]
  6. This PR did not break BC: ! - did not

    have an interface - did affect signature but mildly - is going to go in 2.6 - is not a bugfix (not in 2.5.1) - if you were extending via extra arguments then is going to break your app
  7. class MyDomain extends BaseDomain { public function $b($arg1, $arg2); }

    ! class BaseDomain ... { public function $b($arg1) { // ... } }
  8. class MyDomain implements DomainInterface { public function $b($arg1, $arg2); }

    ! interface DomainInterface ... { public function $b($arg1); } !
  9. namespace Symfony\... ! /** * @internal (aka non-public api) */

    interface ImplementAtYourOwnRisk { // will grow or shrink or worse } !
  10. class ConfigCollectionInfo extends Event { protected $collections = array(); !

    public function addCollection( $collection, ConfigFactoryOverrideInterface ... ); ! public function getCollectionNames(...); ! public function getOverrideService(...); } Not so good
  11. class Yaml implements SerializationInterface { public static function encode($data) {

    return Symfony::dump($data, ...); } ! public static function decode($raw) { return Symfony::parse($raw, true); }
  12. mind all things: ! - respect encapsulation - respect api’s

    - respect your code - use deprecation
  13. sdboyer - frozone (new Counter()) // count = 0 ->isFrozen()

    // false ->increment() // count = 1 ->freeze() ! ->isFrozen() // true ->increment() // exception ;
  14. Ever wanted to use phing or ant but in yaml

    and have your own functions? bldr.io my friend ! Aaron Scherer
  15. Ever wanted to be fast! maintaining or contributing to a

    repository on GitHub? gushphp.org @sstok @dantleech all contributors