SlideShare a Scribd company logo
1 of 56
Download to read offline
venerdì 1 febbraio 2013
venerdì 1 febbraio 2013
per chi viene da




venerdì 1 febbraio 2013
per chi viene da




venerdì 1 febbraio 2013
Michele Orselli

                          CTO@Ideato

                          @_orso_
                          mo@ideato.it




      who Am I?
venerdì 1 febbraio 2013
Michele Orselli

                          CTO@Ideato

                          @_orso_
                          mo@ideato.it




      who Am I?
venerdì 1 febbraio 2013
Symfony 1.x/2 developer




      who Am I?
venerdì 1 febbraio 2013
I’m biased
venerdì 1 febbraio 2013
dependency injection
                                                     request
                                       component
                                                          command
                          event
                                       service      MVC

                            listener                  response
                                       app layout



      I’m biased
venerdì 1 febbraio 2013
Zend Framework 2

                           - legacy app/db
                           - soap api
                           - restish api




      my 1st zf2 project
venerdì 1 febbraio 2013
the journey begins
venerdì 1 febbraio 2013
sf2 & zf2 ♥ standards




      standards
venerdì 1 febbraio 2013
PSR-*
 PSR-0: autoloading
 PSR-1/2: coding standard
 PSR-3: logging

 https://github.com/php-fig/fig-standards




      standards
venerdì 1 febbraio 2013
3rd party libs



      don’t reinvent the wheel
venerdì 1 febbraio 2013
3rd party libs
 ASSETIC: asset management
 COMPOSER: package management
 DOCTRINE: ORM
 TWIG: templating engine




      don’t reinvent the wheel
venerdì 1 febbraio 2013
components
venerdì 1 febbraio 2013
BrowserKit: simulates a browser
 CssSelector: converts CSS selector to XPath expression
 DomCrawler: easy DOM navigation
 Process: asset management
 Finder: package management
 HTTPFoundation: package management
 DependencyInjection: dependency injection container
 EventDispatcher: observer pattern




      Sf2 components
venerdì 1 febbraio 2013
Soap: a soap server/client with wsdl generation
 InputFilter: user input filter
 DomQuery: easy DOM navigation
 Validator: user input valdator
 Ser viceManager: a service locator implementation
 MVC: an mvc implementation
 DI: dependency injection container
 EventManager: observer pattern




      Zf2 components
venerdì 1 febbraio 2013
components implement well known patterns




      well know (?) pattern
venerdì 1 febbraio 2013
EventManager vs EventDispatcher
venerdì 1 febbraio 2013
composer.json




      Integration via composer
venerdì 1 febbraio 2013
Bundles/Modules


      toward bigger blocks
venerdì 1 febbraio 2013
Bundle: group of PHP, javascript, css, config files
implementing a feature.

Almost everything in sf2 is in a bundle




      Sf2 Bundles
venerdì 1 febbraio 2013
Acme/
      DemoBundle/
        Controller/
        Command/
        Entity/
        Resources/
          config/
            ser vices.yml
            routing.yml
          public/
          views/
        Test/
        AcmeDemoBundle.php

      Sf2 Bundle dir structure
venerdì 1 febbraio 2013
Module: group of PHP, javascript, css, config files
   implementing a feature.




      Zf2 Modules
venerdì 1 febbraio 2013
Application/
      config/
        module.config.php
      src/
        Application/
           Controller/
           Ser vice/
      view/
      test/
        ApplicationTest/
      Module.php


      Zf2 Module dir structure
venerdì 1 febbraio 2013
AcmeDemoBundle.php




      Sf2 Bundle app integration
venerdì 1 febbraio 2013
Module.php




      Zf2 Module dir structure
venerdì 1 febbraio 2013
services.xml




      Sf2 service definition
venerdì 1 febbraio 2013
services.xml




      Sf2 service definition
venerdì 1 febbraio 2013
where’s the DIC???




      wait a minute...
venerdì 1 febbraio 2013
Module.php




      Zf2 service locator
venerdì 1 febbraio 2013
Module.php




      Zf2 events
venerdì 1 febbraio 2013
routing.yml




          CompanyController.php




      Sf2 MVC
venerdì 1 febbraio 2013
kernel.request
          kernel.controller
          kernel.view
          kernel.response
          kernel.exception
          kernel.terminate




      Sf2 Events
venerdì 1 febbraio 2013
modules.config.php




         IndexController.php




      Zf2 MVC
venerdì 1 febbraio 2013
Module.php




         IndexController.php




      Zf2 Controller Plugin
venerdì 1 febbraio 2013
ZendMvcApplication: bootstrap
     ZendMvcApplication: route
     ZendMvcApplication: dispatch
     ZendMvcControllerActionController: dispatch
     ZendMvcApplication: dispatch.error
     ZendMvcApplication: render
     ZendViewView: renderer
     ZendViewView: response
     ZendMvcApplication: finish




      Zf2 Events
venerdì 1 febbraio 2013
php app/console




      sf2 console
venerdì 1 febbraio 2013
MyCommand.php




      sf2 console
venerdì 1 febbraio 2013
where’s the console???




      zf2 console
venerdì 1 febbraio 2013
modules.config.php




         CrawlController.php




      zf2 controllers as console command
venerdì 1 febbraio 2013
app/
           config/
              config.yml
              config_*.yml
              routing.yml
              routing_dev.yml
           AppKernel.php
           console
         src/
         vendor/
         web/
           app.php
           app_dev.php


      Sf2 app structure
venerdì 1 febbraio 2013
app/
           config/
             autoload/
                global.php
                local.php.dist
             application.config.php
         module/
         vendor/
         public/
           index.php



      Zf2 app structure
venerdì 1 febbraio 2013
wrap up


      what I take home?
venerdì 1 febbraio 2013
bumpy ride initially
venerdì 1 febbraio 2013
what I’ve missed from Sf2
venerdì 1 febbraio 2013
Symfony standard edition




      what I’ve missed from Sf2
venerdì 1 febbraio 2013
Symfony cheatsheet




      what I’ve missed from Sf2
venerdì 1 febbraio 2013
learning Zf2 if you know
                            Sf2 is quite smooth...



      what I take home?
venerdì 1 febbraio 2013
if...




      what I take home?
venerdì 1 febbraio 2013
you read the docs


      what I take home?
venerdì 1 febbraio 2013
http://framework.zend.com/manual/2.0/en/index.html

            http://modules.zendframework.com/

            http://www.mwop.net

            http://akrabat.com/category/zend-framework-2/

            http://ocramius.github.com/

            http://www.maltblue.com/tag/zend-framework

            http://juriansluiman.nl/en/



            ... you get it




      what I take home?
venerdì 1 febbraio 2013
you read the code


      what I take home?
venerdì 1 febbraio 2013
https://github.com/zendframework

            https://github.com/weierophinney

            https://github.com/Ocramius

            https://packagist.org/



            ... you get it




      what I take home?
venerdì 1 febbraio 2013
Thank YOU!
            Pics Credits:

            Glass: http://www.flickr.com/photos/daveynin/6722545177/

            Journey: http://www.flickr.com/photos/landrovermena/7086355379/

            Components: http://www.flickr.com/photos/37996583811@N01/5955271663/

            Not Found: http://www.flickr.com/photos/girliemac/6508022985/

                                                                                @_orso_

                                                                            mo@ideato.it
      that’s all folks!
venerdì 1 febbraio 2013

More Related Content

More from Michele Orselli

A recommendation engine for your applications codemotion ams
A recommendation engine for your applications codemotion amsA recommendation engine for your applications codemotion ams
A recommendation engine for your applications codemotion amsMichele Orselli
 
A recommendation engine for your applications phpday
A recommendation engine for your applications phpdayA recommendation engine for your applications phpday
A recommendation engine for your applications phpdayMichele Orselli
 
Hopping in clouds - phpuk 17
Hopping in clouds - phpuk 17Hopping in clouds - phpuk 17
Hopping in clouds - phpuk 17Michele Orselli
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Michele Orselli
 
Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Michele Orselli
 
Implementing data sync apis for mibile apps @cloudconf
Implementing data sync apis for mibile apps @cloudconfImplementing data sync apis for mibile apps @cloudconf
Implementing data sync apis for mibile apps @cloudconfMichele Orselli
 
Server side data sync for mobile apps with silex
Server side data sync for mobile apps with silexServer side data sync for mobile apps with silex
Server side data sync for mobile apps with silexMichele Orselli
 
Continuous, continuous, continuous
Continuous, continuous, continuousContinuous, continuous, continuous
Continuous, continuous, continuousMichele Orselli
 
Deploy a PHP App on Google App Engine
Deploy a PHP App on Google App EngineDeploy a PHP App on Google App Engine
Deploy a PHP App on Google App EngineMichele Orselli
 
Deploy a php app on Google App Engine
Deploy a php app on Google App EngineDeploy a php app on Google App Engine
Deploy a php app on Google App EngineMichele Orselli
 
Manage a project portfolio
Manage a project portfolioManage a project portfolio
Manage a project portfolioMichele Orselli
 
Developing sustainable php projects
Developing sustainable php projectsDeveloping sustainable php projects
Developing sustainable php projectsMichele Orselli
 
Symfony CMF: un nuovo paradigma per la gestione dei contenuti
Symfony CMF: un nuovo paradigma per la gestione dei contenutiSymfony CMF: un nuovo paradigma per la gestione dei contenuti
Symfony CMF: un nuovo paradigma per la gestione dei contenutiMichele Orselli
 
Dica trentatrè. <?php echo "33"; ?>. Controllare lo stato di salute di una...
Dica trentatrè. <?php echo "33"; ?>. Controllare lo stato di salute di una...Dica trentatrè. <?php echo "33"; ?>. Controllare lo stato di salute di una...
Dica trentatrè. <?php echo "33"; ?>. Controllare lo stato di salute di una...Michele Orselli
 

More from Michele Orselli (20)

A dive into Symfony 4
A dive into Symfony 4A dive into Symfony 4
A dive into Symfony 4
 
A recommendation engine for your applications codemotion ams
A recommendation engine for your applications codemotion amsA recommendation engine for your applications codemotion ams
A recommendation engine for your applications codemotion ams
 
A recommendation engine for your applications phpday
A recommendation engine for your applications phpdayA recommendation engine for your applications phpday
A recommendation engine for your applications phpday
 
Hopping in clouds - phpuk 17
Hopping in clouds - phpuk 17Hopping in clouds - phpuk 17
Hopping in clouds - phpuk 17
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)
 
Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))
 
Migrare a Symfony 3
Migrare a Symfony 3Migrare a Symfony 3
Migrare a Symfony 3
 
Vagrant for real
Vagrant for realVagrant for real
Vagrant for real
 
Implementing data sync apis for mibile apps @cloudconf
Implementing data sync apis for mibile apps @cloudconfImplementing data sync apis for mibile apps @cloudconf
Implementing data sync apis for mibile apps @cloudconf
 
Server side data sync for mobile apps with silex
Server side data sync for mobile apps with silexServer side data sync for mobile apps with silex
Server side data sync for mobile apps with silex
 
Continuous, continuous, continuous
Continuous, continuous, continuousContinuous, continuous, continuous
Continuous, continuous, continuous
 
Deploy a PHP App on Google App Engine
Deploy a PHP App on Google App EngineDeploy a PHP App on Google App Engine
Deploy a PHP App on Google App Engine
 
Deploy a php app on Google App Engine
Deploy a php app on Google App EngineDeploy a php app on Google App Engine
Deploy a php app on Google App Engine
 
Sf2 wtf
Sf2 wtfSf2 wtf
Sf2 wtf
 
Manage a project portfolio
Manage a project portfolioManage a project portfolio
Manage a project portfolio
 
Developing sustainable php projects
Developing sustainable php projectsDeveloping sustainable php projects
Developing sustainable php projects
 
Symfony CMF: un nuovo paradigma per la gestione dei contenuti
Symfony CMF: un nuovo paradigma per la gestione dei contenutiSymfony CMF: un nuovo paradigma per la gestione dei contenuti
Symfony CMF: un nuovo paradigma per la gestione dei contenuti
 
Dica trentatrè. <?php echo "33"; ?>. Controllare lo stato di salute di una...
Dica trentatrè. <?php echo "33"; ?>. Controllare lo stato di salute di una...Dica trentatrè. <?php echo "33"; ?>. Controllare lo stato di salute di una...
Dica trentatrè. <?php echo "33"; ?>. Controllare lo stato di salute di una...
 
Symfony2 cmf
Symfony2 cmfSymfony2 cmf
Symfony2 cmf
 
Abstract Symfony2 CMF
Abstract Symfony2 CMFAbstract Symfony2 CMF
Abstract Symfony2 CMF
 

Zend Framework 2 per chi viene da Symfony2

  • 3. per chi viene da venerdì 1 febbraio 2013
  • 4. per chi viene da venerdì 1 febbraio 2013
  • 5. Michele Orselli CTO@Ideato @_orso_ mo@ideato.it who Am I? venerdì 1 febbraio 2013
  • 6. Michele Orselli CTO@Ideato @_orso_ mo@ideato.it who Am I? venerdì 1 febbraio 2013
  • 7. Symfony 1.x/2 developer who Am I? venerdì 1 febbraio 2013
  • 8. I’m biased venerdì 1 febbraio 2013
  • 9. dependency injection request component command event service MVC listener response app layout I’m biased venerdì 1 febbraio 2013
  • 10. Zend Framework 2 - legacy app/db - soap api - restish api my 1st zf2 project venerdì 1 febbraio 2013
  • 11. the journey begins venerdì 1 febbraio 2013
  • 12. sf2 & zf2 ♥ standards standards venerdì 1 febbraio 2013
  • 13. PSR-* PSR-0: autoloading PSR-1/2: coding standard PSR-3: logging https://github.com/php-fig/fig-standards standards venerdì 1 febbraio 2013
  • 14. 3rd party libs don’t reinvent the wheel venerdì 1 febbraio 2013
  • 15. 3rd party libs ASSETIC: asset management COMPOSER: package management DOCTRINE: ORM TWIG: templating engine don’t reinvent the wheel venerdì 1 febbraio 2013
  • 17. BrowserKit: simulates a browser CssSelector: converts CSS selector to XPath expression DomCrawler: easy DOM navigation Process: asset management Finder: package management HTTPFoundation: package management DependencyInjection: dependency injection container EventDispatcher: observer pattern Sf2 components venerdì 1 febbraio 2013
  • 18. Soap: a soap server/client with wsdl generation InputFilter: user input filter DomQuery: easy DOM navigation Validator: user input valdator Ser viceManager: a service locator implementation MVC: an mvc implementation DI: dependency injection container EventManager: observer pattern Zf2 components venerdì 1 febbraio 2013
  • 19. components implement well known patterns well know (?) pattern venerdì 1 febbraio 2013
  • 21. composer.json Integration via composer venerdì 1 febbraio 2013
  • 22. Bundles/Modules toward bigger blocks venerdì 1 febbraio 2013
  • 23. Bundle: group of PHP, javascript, css, config files implementing a feature. Almost everything in sf2 is in a bundle Sf2 Bundles venerdì 1 febbraio 2013
  • 24. Acme/ DemoBundle/ Controller/ Command/ Entity/ Resources/ config/ ser vices.yml routing.yml public/ views/ Test/ AcmeDemoBundle.php Sf2 Bundle dir structure venerdì 1 febbraio 2013
  • 25. Module: group of PHP, javascript, css, config files implementing a feature. Zf2 Modules venerdì 1 febbraio 2013
  • 26. Application/ config/ module.config.php src/ Application/ Controller/ Ser vice/ view/ test/ ApplicationTest/ Module.php Zf2 Module dir structure venerdì 1 febbraio 2013
  • 27. AcmeDemoBundle.php Sf2 Bundle app integration venerdì 1 febbraio 2013
  • 28. Module.php Zf2 Module dir structure venerdì 1 febbraio 2013
  • 29. services.xml Sf2 service definition venerdì 1 febbraio 2013
  • 30. services.xml Sf2 service definition venerdì 1 febbraio 2013
  • 31. where’s the DIC??? wait a minute... venerdì 1 febbraio 2013
  • 32. Module.php Zf2 service locator venerdì 1 febbraio 2013
  • 33. Module.php Zf2 events venerdì 1 febbraio 2013
  • 34. routing.yml CompanyController.php Sf2 MVC venerdì 1 febbraio 2013
  • 35. kernel.request kernel.controller kernel.view kernel.response kernel.exception kernel.terminate Sf2 Events venerdì 1 febbraio 2013
  • 36. modules.config.php IndexController.php Zf2 MVC venerdì 1 febbraio 2013
  • 37. Module.php IndexController.php Zf2 Controller Plugin venerdì 1 febbraio 2013
  • 38. ZendMvcApplication: bootstrap ZendMvcApplication: route ZendMvcApplication: dispatch ZendMvcControllerActionController: dispatch ZendMvcApplication: dispatch.error ZendMvcApplication: render ZendViewView: renderer ZendViewView: response ZendMvcApplication: finish Zf2 Events venerdì 1 febbraio 2013
  • 39. php app/console sf2 console venerdì 1 febbraio 2013
  • 40. MyCommand.php sf2 console venerdì 1 febbraio 2013
  • 41. where’s the console??? zf2 console venerdì 1 febbraio 2013
  • 42. modules.config.php CrawlController.php zf2 controllers as console command venerdì 1 febbraio 2013
  • 43. app/ config/ config.yml config_*.yml routing.yml routing_dev.yml AppKernel.php console src/ vendor/ web/ app.php app_dev.php Sf2 app structure venerdì 1 febbraio 2013
  • 44. app/ config/ autoload/ global.php local.php.dist application.config.php module/ vendor/ public/ index.php Zf2 app structure venerdì 1 febbraio 2013
  • 45. wrap up what I take home? venerdì 1 febbraio 2013
  • 46. bumpy ride initially venerdì 1 febbraio 2013
  • 47. what I’ve missed from Sf2 venerdì 1 febbraio 2013
  • 48. Symfony standard edition what I’ve missed from Sf2 venerdì 1 febbraio 2013
  • 49. Symfony cheatsheet what I’ve missed from Sf2 venerdì 1 febbraio 2013
  • 50. learning Zf2 if you know Sf2 is quite smooth... what I take home? venerdì 1 febbraio 2013
  • 51. if... what I take home? venerdì 1 febbraio 2013
  • 52. you read the docs what I take home? venerdì 1 febbraio 2013
  • 53. http://framework.zend.com/manual/2.0/en/index.html http://modules.zendframework.com/ http://www.mwop.net http://akrabat.com/category/zend-framework-2/ http://ocramius.github.com/ http://www.maltblue.com/tag/zend-framework http://juriansluiman.nl/en/ ... you get it what I take home? venerdì 1 febbraio 2013
  • 54. you read the code what I take home? venerdì 1 febbraio 2013
  • 55. https://github.com/zendframework https://github.com/weierophinney https://github.com/Ocramius https://packagist.org/ ... you get it what I take home? venerdì 1 febbraio 2013
  • 56. Thank YOU! Pics Credits: Glass: http://www.flickr.com/photos/daveynin/6722545177/ Journey: http://www.flickr.com/photos/landrovermena/7086355379/ Components: http://www.flickr.com/photos/37996583811@N01/5955271663/ Not Found: http://www.flickr.com/photos/girliemac/6508022985/ @_orso_ mo@ideato.it that’s all folks! venerdì 1 febbraio 2013