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

SymfonyCon 2013 Keynote

SymfonyCon 2013 Keynote

Fabien Potencier

December 13, 2013
Tweet

More Decks by Fabien Potencier

Other Decks in Programming

Transcript

  1. Console Event Dispatcher Finder HTTP Foundation HTTP Kernel Yaml Process

    Routing Translation Dom Crawler Filesystem CSS Selector Browser Kit ICU Debug
  2. DD4E C589 15FF 888A 8A3D D898 EB8A A69A 566C 0795

    http://fabien.potencier.org/about
  3. $ git show --show-signature v2.2.11 tag v2.2.11 Tagger: Fabien Potencier

    <[email protected]> Date: Mon Dec 2 08:14:10 2013 +0100 created tag 2.2.11 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (Darwin) iF4EABEIAAYFAlKcM0IACgkQ64qmmlZsB5X7RwD9F9musp/IGt0NJdlUv6/V27NC o9KciAtVdHY8wQ8NuDsBAJ1X483uJqPzhP1dy1LdCIgFPAmw/qYmKL2m2wD7Bega =142E -----END PGP SIGNATURE----- commit 6a9c223b066a2553b8f59fd26f84ea630eff403c Author: Fabien Potencier <[email protected]> Date: Mon Dec 2 08:14:10 2013 +0100 updated VERSION for 2.2.11
  4. $ git tag -v v2.2.11 object 6a9c223b066a2553b8f59fd26f84ea630eff403c type commit tag

    v2.2.11 tagger Fabien Potencier <[email protected]> 1385968450 +0100 created tag 2.2.11 gpg: Signature made Mon Dec 2 08:14:10 2013 CET using DSA key ID 566C0795 gpg: Good signature from "Fabien Potencier (fabpot) <[email protected]>" gpg: aka "Fabien Potencier (fabpot) <[email protected]>
  5. bug #9607 [HttpKernel] Fix a bug when using the kernel...

    (gnutix) bug #9597 [Security] Typos in Security's ExpressionLanguage (ovrflo) minor #9598 [SecurityBundle] minor simplification in ... (shieldo) minor #9599 [Validator] Typo and better wording for ... (Danez) minor #9588 Add missing german translation for validators (Danez) feature #9587 [SecurityBundle] Added csrf_token_generator... (shieldo) feature #9578 [DomCrawler] Fixes `attr` method returning ... (aik099)
  6. commit b00289a6d0472f09b44d6aa0cb2411c36453ee31 Merge: f2b60e9 ea91533 Author: Fabien Potencier <[email protected]> Date:

    Tue Oct 8 10:34:28 2013 +0200 bug #9236 [Form] fix missing use statement for exception UnexpectedTypeException (jaugustin) This PR was merged into the master branch. Discussion ---------- [Form] fix missing use statement for ex UnexpectedTypeException | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | | Fixed tickets | | License | MIT | Doc PR | fix missing use statement for exception `Symfony\Component\Form \Exception\UnexpectedTypeException`
  7. gh merge 1234 This PR was merged into the master

    branch. gh merge 1234 --switch=2.2 This PR was submitted for the 2.4 branch but it was merged into the 2.2 branch instead.
  8. gh merge 1234 This PR was merged into the master

    branch. gh merge 1234 --squash This PR was squashed before being merged into the 2.2 branch.
  9. gh merge 1234 --squash --switch=2.2 This PR was submitted for

    the 2.4 branch but it was squashed and merged into the 2.2 branch instead.
  10. gh merge 1234 This PR was merged into the 2.5-dev

    branch. gh merge 1234 This PR was merged into the master branch.
  11. git log -1 --show-notes=github-comments 5bd18c0 commit 5bd18c01a3c20ddd3710b798b33317ca709cb826 Merge: 04d767d da9bee0

    Author: Fabien Potencier <[email protected]> Date: Wed Oct 2 14:11:08 2013 +0200 feature #9196 [Console] added a compact layout for table (fabpot) This PR was merged into the master branch. Discussion ---------- [Console] added a compact layout for the table helper ... Notes (github-comments): ------------------------------------------------------------------- by stof at 2013-10-02T07:44:21Z :+1:
  12. Blogs at symfony.es Writes a week of Symfony - 2007

    Published a book on Symfony2 organizes Javier Eguiluz Evangelist at
  13. Note: This is a wireframe mockup, not a graphic design

    The new Symfony download experience Download Symfony Framework Install Symfony 2.3 via Composer $ composer create-project symfony/framework-standard-edition my-project/ 2.3.7 What is Composer and how to install it DOWNLOAD SYMFONY 2.3.7 Download Symfony 2.3 as a ZIP file Uncompress the file under your web server root directory Choose Symfony 2.3 for long-term support Choose Symfony 2.4 for the latest features (supported until May 2016) (supported until July 2014) SAME AS SHOWN ABOVE
  14. A modern Twig snippet {{ max({ ... }) }} {{

    min({ ... }) }} {{ 42.55|round }} {{ 42.55|round(3, 'floor') }} {{ source('layout.html.twig') }} {{ source('@admin/common/_sidebar.twig') }} TWIG 1.15
  15. . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . symfony.com/community/france Symfony Community in France Events 22 DEC 9 JAN Blogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Community members
  16. . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . symfony.com/community/france Symfony Community in France Events 22 DEC 9 JAN Blogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Community members
  17. $app['shared_service'] = $app->share(function () { return new stdClass(); }); $app['factory_service']

    = function () { return new stdClass(); }; Pimple 1.x 99% of all services
  18. $app['shared_service'] = function () { return new stdClass(); }; $app['factory_service']

    = $app->factory(function () { return new stdClass(); }); Pimple 2.x 99% of all services
  19. in ms Pimple1 Pimple2 get shared 116 21 x 5.5

    set shared 78 26 x 3.0 get factory 112 116 x 1.0 set factory 23 172 x 0.13 Pimple
  20. in ms Pimple2 PHP Pimple2 hhvm get shared 21 6

    x 3.5 set shared 26 8.8 x 2.9 get factory 116 60 x 1.9 set factory 172 56 x 3.1 Pimple
  21. in ms Pimple2 Pimple2C get shared 21 2.7 x 7.8

    set shared 26 5.5 x 4.7 get factory 116 42 x 2.7 set factory 172 29 x 5.9 Pimple
  22. in ms Pimple2 hhvm Pimple2C get shared 6 2.7 x

    2.2 set shared 8.8 5.5 x 1.6 get factory 60 42 x 1.4 set factory 56 29 x 1.9 Pimple
  23. in ms Pimple1 Pimple2C get shared 116 2.7 x 43

    set shared 78 5.5 x 15 get factory 112 42 x 3 set factory 23 29 x 0.8 Pimple
  24. Release Manager for 5.5/5.6 PHP Contributor Wrote a book on

    PHP performance Works on a book on PHP internals h﬙p:/ /www.phpinternalsbook.com/ Julien Pauli Performance guy at
  25. What extensions can do  Extensions can :  Add

    new functions  Add new classes / interfaces  Add and manage php.ini se﬙ings and phpinfo() output  Add new global variables or constants  Add new stream wrappers/filters, new resource ﬚pes  Overwrite what other extensions defined  Extensions cannot :  Modi﬌ PHP syntax  Change the engine executor behavior (zend_extension can)
  26. Why create an extension?  Bundle an external library code

    into PHP  Example h﬙ps:/ /github.com/nicolasff/phpredis  Optimize performances  C is way faster than PHP  Create your own C structures and manage them by providing PHP functions  Create your own resource intensive algorithms  Example : h﬙ps:/ /github.com/phadej/igbinary
  27. C vs PHP  Don't try to turn the world

    to C  Why you should use PHP over C  C is way more difficult to develop than PHP  C is very less maintainable  C can be tricky to debug  Why you should use C over PHP  Bundle an external lib into PHP (cant be done in PHP)  Looking for speed and fast algos  Changing PHP behavior deeply
  28. PHP Objects internals  What you see from PHP land

    is just a "default implementation" in the engine  The ZendEngine 2 (PHP 5) has been designed with a highly extensible object model $o = new MyObject; $o->anAttribute; $o->aMethodCall();
  29. PHP Objects internals  An object is a zend_object 

    A class is a zend_class_entry typedef struct _zend_object { zend_class_entry *ce; HashTable *properties; zval **properties_table; HashTable *guards; /* protects from __get/__set ... recursion */ } zend_object;
  30. PHP Object handlers  Handlers define objects behaviors struct _zend_object_handlers

    { zend_object_add_ref_t add_ref; zend_object_del_ref_t del_ref; zend_object_clone_obj_t clone_obj; zend_object_read_property_t read_property; zend_object_write_property_t write_property; zend_object_read_dimension_t read_dimension; zend_object_write_dimension_t write_dimension; zend_object_has_property_t has_property; zend_object_unset_property_t unset_property; zend_object_has_dimension_t has_dimension; zend_object_unset_dimension_t unset_dimension; zend_object_get_properties_t get_properties; zend_object_get_method_t get_method; zend_object_call_method_t call_method; zend_object_get_constructor_t get_constructor; zend_object_get_class_entry_t get_class_entry; ...
  31. PHP default object handlers  Default handlers exist  They

    define the default PHP behavior you all know  For example, the default "read_dimension" handler  Check's if the object class implements ArrayAccess  Calls for OffsetGet()  Returns what OffsetGet() returned
  32. Changing object handlers  By redefining these handlers, one can

     Directly fetch information instead of calling a PHP function to do so  Create special storage and fetchers for a﬙ributes  Change the way objects are stored and retrieved from the engine  This is what has been done in the C version of Pimple