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. State of the
    Symfony
    World
    FabienPotencier
    @fabpot
    h﬙ps:/
    /secure.flickr.com/photos/keithmwilliams/5727282051

    View full-size slide

  2. State of the
    Symfony
    World
    FabienPotencier
    @fabpot
    h﬙ps:/
    /secure.flickr.com/photos/keithmwilliams/5727282051

    View full-size slide

  3. Stats
    https://secure.flickr.com/photos/cdm/39449485

    View full-size slide

  4. Twig
    1.9M downloads

    View full-size slide

  5. 1.7M downloads

    View full-size slide

  6. ~22M
    downloads

    View full-size slide

  7. Console
    Event Dispatcher
    Finder
    HTTP Foundation
    HTTP Kernel
    Yaml
    Process
    Routing
    Translation
    Dom Crawler
    Filesystem
    CSS Selector
    Browser Kit
    ICU
    Debug

    View full-size slide

  8. easybook
    Sulu CMF

    View full-size slide

  9. The
    Symfony
    Family
    https://secure.flickr.com/photos/65073487@N00/3132301417

    View full-size slide

  10. h﬙p:/
    /symfony.com/components

    View full-size slide

  11. h﬙p:/
    /symfony.com/components/H﬙pKernel

    View full-size slide

  12. h﬙p:/
    /symfony.com/projects

    View full-size slide

  13. h﬙p:/
    /symfony.com/projects/phpbb

    View full-size slide

  14. Add your project to the
    SymfonyFamily today!
    h﬙ps:/
    /github.com/symfony/symfony-marketing/tree/component/projects
    40+
    projects
    https://secure.flickr.com/photos/kismihok/2894418909

    View full-size slide

  15. symfony.com
    https://secure.flickr.com/photos/mmoosa/3501992313

    View full-size slide

  16. h﬙p:/
    /symfony.com/roadmap

    View full-size slide

  17. Processes
    https://secure.flickr.com/photos/mamzellekaelle/9954858305

    View full-size slide

  18. DD4E C589 15FF 888A 8A3D D898 EB8A A69A 566C 0795
    http://fabien.potencier.org/about

    View full-size slide

  19. $ git show --show-signature v2.2.11
    tag v2.2.11
    Tagger: Fabien Potencier
    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
    Date: Mon Dec 2 08:14:10 2013 +0100
    updated VERSION for 2.2.11

    View full-size slide

  20. $ git tag -v v2.2.11
    object 6a9c223b066a2553b8f59fd26f84ea630eff403c
    type commit
    tag v2.2.11
    tagger Fabien Potencier 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) "
    gpg: aka "Fabien Potencier (fabpot)

    View full-size slide

  21. fabpot’s
    tools
    https://secure.flickr.com/photos/craigwalkowicz/4599433039

    View full-size slide

  22. $ gh merge 1234

    View full-size slide

  23. Working on symfony/symfony (branch master)
    Merging Pull Request 9196: fabpot:table-compact
    Category (feature, bug, minor)?

    View full-size slide

  24. 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)

    View full-size slide

  25. git log --grep="bug *#" --merges --format="%s" \
    v2.2.10...v2.2.11

    View full-size slide

  26. commit b00289a6d0472f09b44d6aa0cb2411c36453ee31
    Merge: f2b60e9 ea91533
    Author: Fabien Potencier
    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`

    View full-size slide

  27. 2.3 2.4 2.5-dev
    bug fixes

    View full-size slide

  28. 2.3 2.4 2.5-dev
    new features

    View full-size slide

  29. 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.

    View full-size slide

  30. 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.

    View full-size slide

  31. 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.

    View full-size slide

  32. gh merge 1234
    This PR was merged into the 2.5-dev branch.
    gh merge 1234
    This PR was merged into the master branch.

    View full-size slide

  33. git fetch origin refs/notes/*:refs/notes/*
    fetch = +refs/notes/*:refs/notes/*

    View full-size slide

  34. git log -1 --show-notes=github-comments 5bd18c0
    commit 5bd18c01a3c20ddd3710b798b33317ca709cb826
    Merge: 04d767d da9bee0
    Author: Fabien Potencier
    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:

    View full-size slide

  35. $ gh move symfony/Console#1234

    View full-size slide

  36. $ gh label --new --issues

    View full-size slide

  37. https://gist.github.com/fabpot/7887553

    View full-size slide

  38. Coding Standards
    Madness

    View full-size slide

  39. Coding Standards
    Madness
    Typos
    Madness

    View full-size slide

  40. ubot.io
    https://secure.flickr.com/photos/donsolo/2472473711

    View full-size slide

  41. common ﬚po fix
    CS fix

    View full-size slide

  42. ubot.io
    active later today!
    https://secure.flickr.com/photos/donsolo/2472473711

    View full-size slide

  43. Blogs at symfony.es
    Writes a week of Symfony - 2007
    Published a book on Symfony2
    organizes
    Javier Eguiluz
    Evangelist at

    View full-size slide

  44. code
    pull
    requests
    github
    tests
    community
    local events
    certification
    documentation
    marketing
    blogs
    bundles

    View full-size slide

  45. code
    pull
    requests
    github
    tests
    community
    local events
    certification
    documentation
    marketing
    blogs
    bundles

    View full-size slide

  46. code
    pull
    requests
    github
    tests
    community
    local events
    certification
    documentation
    marketing
    blogs
    bundles

    View full-size slide

  47. 4 5
    3
    2
    1
    Five random ideas to improve Symfony

    View full-size slide

  48. 4 5
    3
    2
    1
    Five random ideas to improve Symfony

    View full-size slide

  49. The Symfony download experience

    View full-size slide

  50. The Symfony download experience

    View full-size slide

  51. 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

    View full-size slide

  52. The new Symfony experience
    Contributors
    Community
    Bundles
    Blog
    Download

    View full-size slide

  53. The new Symfony experience
    Contributors
    Community
    Bundles
    Blog
    Download

    View full-size slide

  54. 4 5
    3
    2
    1
    Five random ideas to improve Symfony

    View full-size slide

  55. The symfony-devs mailing list

    View full-size slide

  56. 4 5
    3
    2
    1
    Five random ideas to improve Symfony

    View full-size slide

  57. Do you regularly visit the
    official Symfony blog?

    View full-size slide

  58. Do you regularly visit the
    official Twig blog?

    View full-size slide

  59. 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

    View full-size slide

  60. blog.twig
    .sensiolabs.org
    blog
    .swiftmailer.org
    blog.silex
    .sensiolabs.org
    symfony.com/blog
    TWIG
    SF
    SILEX
    SWIF
    T
    SF
    SF
    TWIG
    SILEX
    TWIG
    SF
    SF
    SF
    SF
    SF
    SF
    SF

    View full-size slide

  61. blog.twig
    .sensiolabs.org
    blog
    .swiftmailer.org
    blog.silex
    .sensiolabs.org
    symfony.com/blog
    TWIG
    SF
    SILEX
    SWIF
    T
    SF
    SF
    TWIG
    SILEX
    TWIG
    SF

    View full-size slide

  62. 4 5
    3
    2
    1
    Five random ideas to improve Symfony

    View full-size slide

  63. The French Community
    afsy.fr/
    avent/2013
    sfPot Paris / Marseille

    View full-size slide

  64. The Spanish Community
    deSymfony 2013 Madrid

    View full-size slide

  65. The German Community
    Hamburg
    Cologne
    Berlin Munich

    View full-size slide

  66. Symfony Camp UA 2013
    Symfony Tunisia 2013 Symfony Day Italy 2013
    November Camp Sweden

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  69. 4 5
    3
    2
    1
    Five random ideas to improve Symfony

    View full-size slide

  70. +2,200
    bundles

    View full-size slide

  71. 8 CAPTCHA
    There are
    bundles
    for

    View full-size slide

  72. please
    share your ideas
    to improve Symfony

    View full-size slide

  73. Performance
    https://secure.flickr.com/photos/fatboyke/2668411239

    View full-size slide

  74. Twig
    C extension
    foo.bar

    View full-size slide

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

    View full-size slide

  76. $app['shared_service'] = function () {
    return new stdClass();
    };
    $app['factory_service'] = $app->factory(function () {
    return new stdClass();
    });
    Pimple 2.x
    99%
    of all services

    View full-size slide

  77. 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

    View full-size slide

  78. https://secure.flickr.com/photos/haniamir/1810369486

    View full-size slide

  79. 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

    View full-size slide

  80. 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

    View full-size slide

  81. 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

    View full-size slide

  82. 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

    View full-size slide

  83. Pimple
    2.0
    C version

    View full-size slide

  84. 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

    View full-size slide

  85. 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)

    View full-size slide

  86. 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

    View full-size slide

  87. 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

    View full-size slide

  88. 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();

    View full-size slide

  89. 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;

    View full-size slide

  90. 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;
    ...

    View full-size slide

  91. 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

    View full-size slide

  92. 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

    View full-size slide

  93. Experiments
    https://secure.flickr.com/photos/luzbonita/2352396027

    View full-size slide

  94. Join
    the team
    https://secure.flickr.com/photos/beatkueng/3897711772

    View full-size slide

  95. !ank y"!
    https://secure.flickr.com/photos/marfis75/5374308475

    View full-size slide