SlideShare a Scribd company logo
1 of 106
Download to read offline
Integrating
                          symfony and Zend Framework

                          International PHP Conference, 12-10-2010




dinsdag 12 oktober 2010
Welcome




dinsdag 12 oktober 2010
Welcome


               • About frameworks




dinsdag 12 oktober 2010
Welcome


               • About frameworks
               • Zend Framework in symfony projects



dinsdag 12 oktober 2010
Welcome


               • About frameworks
               • Zend Framework in symfony projects
               • symfony in Zend Framework projects


dinsdag 12 oktober 2010
About me




dinsdag 12 oktober 2010
About me

               • Stefan Koopmanschap




dinsdag 12 oktober 2010
About me

               • Stefan Koopmanschap
               • Developer/Consultant/Trainer




dinsdag 12 oktober 2010
About me

               • Stefan Koopmanschap
               • Developer/Consultant/Trainer
               • symfony Community Manager



dinsdag 12 oktober 2010
About me

               • Stefan Koopmanschap
               • Developer/Consultant/Trainer
               • symfony Community Manager
               • Zend Framework Contributor


dinsdag 12 oktober 2010
About me

               • Stefan Koopmanschap
               • Developer/Consultant/Trainer
               • symfony Community Manager
               • Zend Framework Contributor
               • PHPBenelux secretary

dinsdag 12 oktober 2010
dinsdag 12 oktober 2010
Who uses...




dinsdag 12 oktober 2010
Who uses...
               • a PHP framework?




dinsdag 12 oktober 2010
Who uses...
               • a PHP framework?
               • an open source PHP framework?




dinsdag 12 oktober 2010
Who uses...
               • a PHP framework?
               • an open source PHP framework?
               • symfony?



dinsdag 12 oktober 2010
Who uses...
               • a PHP framework?
               • an open source PHP framework?
               • symfony?
               • Zend Framework?


dinsdag 12 oktober 2010
Who uses...
               • a PHP framework?
               • an open source PHP framework?
               • symfony?
               • Zend Framework?
               • More than one framework in the same
                     project?



dinsdag 12 oktober 2010
Frameworks




dinsdag 12 oktober 2010
Frameworks


               • Why?




dinsdag 12 oktober 2010
Frameworks


               • Why?
               • Which?



dinsdag 12 oktober 2010
symfony
dinsdag 12 oktober 2010
Zend Framework
dinsdag 12 oktober 2010
integrate
dinsdag 12 oktober 2010
Zend Framework in
                       symfony projects


dinsdag 12 oktober 2010
Getting set up




dinsdag 12 oktober 2010
Getting set up




dinsdag 12 oktober 2010
dinsdag 12 oktober 2010
dinsdag 12 oktober 2010
dinsdag 12 oktober 2010
Last.fm



dinsdag 12 oktober 2010
Show my friends



dinsdag 12 oktober 2010
dinsdag 12 oktober 2010
dinsdag 12 oktober 2010
dinsdag 12 oktober 2010
Search



dinsdag 12 oktober 2010
Search




dinsdag 12 oktober 2010
Search


               • index my posts




dinsdag 12 oktober 2010
Search


               • index my posts
               • provide search option



dinsdag 12 oktober 2010
Zend Search Lucene



dinsdag 12 oktober 2010
Index
dinsdag 12 oktober 2010
Index
dinsdag 12 oktober 2010
Index
dinsdag 12 oktober 2010
Index
dinsdag 12 oktober 2010
Index
dinsdag 12 oktober 2010
Search
dinsdag 12 oktober 2010
Search
dinsdag 12 oktober 2010
Search
dinsdag 12 oktober 2010
Search
dinsdag 12 oktober 2010
Search
dinsdag 12 oktober 2010
Search
dinsdag 12 oktober 2010
SOAP



dinsdag 12 oktober 2010
SOAP




dinsdag 12 oktober 2010
SOAP


               • No full dispatch




dinsdag 12 oktober 2010
SOAP


               • No full dispatch
               • Expose class/object methods



dinsdag 12 oktober 2010
SOAP


               • No full dispatch
               • Expose class/object methods
               • Use configuration and autoloading


dinsdag 12 oktober 2010
dinsdag 12 oktober 2010
Recycle



dinsdag 12 oktober 2010
Recycle

               • Abstract into plugins
               • Plugins are PEAR packages
               • symfony CLI can install plugins easily
               • Many ZF-based plugins already available


dinsdag 12 oktober 2010
Recycle




dinsdag 12 oktober 2010
Recycle

               • Zend_Mail
               • Zend_OpenId
               • Zend_Cache
               • Zend_Search_Lucene


dinsdag 12 oktober 2010
symfony in Zend
                      Framework projects


dinsdag 12 oktober 2010
Wait, huh?




dinsdag 12 oktober 2010
Wait, huh?


               • symfony (full stack framework)




dinsdag 12 oktober 2010
Wait, huh?


               • symfony (full stack framework)
               • symfony components



dinsdag 12 oktober 2010
Introducing Symfony Components




dinsdag 12 oktober 2010
Introducing Symfony Components




               • completely decoupled components




dinsdag 12 oktober 2010
Introducing Symfony Components




               • completely decoupled components
               • initial work for symfony 1.1



dinsdag 12 oktober 2010
Introducing Symfony Components




               • completely decoupled components
               • initial work for symfony 1.1
               • now available as seperate libraries


dinsdag 12 oktober 2010
Getting set up
dinsdag 12 oktober 2010
YAML




dinsdag 12 oktober 2010
YAML

               •     Yaml library




dinsdag 12 oktober 2010
YAML

               •     Yaml library

               •     Yaml to PHP arrays




dinsdag 12 oktober 2010
YAML

               •     Yaml library

               •     Yaml to PHP arrays

               •     PHP arrays to Yaml




dinsdag 12 oktober 2010
YAML

               •     Yaml library

               •     Yaml to PHP arrays

               •     PHP arrays to Yaml

               •     Advanced errors




dinsdag 12 oktober 2010
YAML
dinsdag 12 oktober 2010
YAML
dinsdag 12 oktober 2010
Event Dispatcher




dinsdag 12 oktober 2010
Event Dispatcher

               •     Observer design pattern




dinsdag 12 oktober 2010
Event Dispatcher

               •     Observer design pattern

               •     Create events




dinsdag 12 oktober 2010
Event Dispatcher

               •     Observer design pattern

               •     Create events

               •     Register actions




dinsdag 12 oktober 2010
Event Dispatcher

               •     Observer design pattern

               •     Create events

               •     Register actions

               •     Actions get triggered




dinsdag 12 oktober 2010
bootstrap code based on http://www.survivethedeepend.com/




                          Event Dispatcher
dinsdag 12 oktober 2010
Event Dispatcher
dinsdag 12 oktober 2010
Dependency Injection




dinsdag 12 oktober 2010
Dependency Injection

               •     Dependency Injection
                     container




dinsdag 12 oktober 2010
Dependency Injection

               •     Dependency Injection
                     container

               •     Based on Spring
                     framework




dinsdag 12 oktober 2010
Dependency Injection

               •     Dependency Injection
                     container

               •     Based on Spring
                     framework

               •     Can contain and
                     instantiate objects




dinsdag 12 oktober 2010
Dependency Injection


               •     “Old” way of doing things

               •     Hardcoded instantiations




dinsdag 12 oktober 2010
Dependency Injection

               •     Remove hardcoded
                     dependencies

               •     Pass dependencies via
                     parameters (or
                     constructor)




dinsdag 12 oktober 2010
Dependency Injection

               •     Remove hardcoded
                     dependencies

               •     Pass dependencies via
                     parameters (or
                     constructor)




dinsdag 12 oktober 2010
Dependency Injection
dinsdag 12 oktober 2010
Templating




dinsdag 12 oktober 2010
Templating

               •     Common templating
                     options




dinsdag 12 oktober 2010
Templating

               •     Common templating
                     options

               •     Object Oriented
                     approach to views




dinsdag 12 oktober 2010
Templating

               •     Common templating
                     options

               •     Object Oriented
                     approach to views

               •     Helpers, Template
                     autoloading, rendering




dinsdag 12 oktober 2010
Output Escaper

               •     Automatic XSS
                     protection

               •     Strings, arrays, objects

               •     in Symfony2




dinsdag 12 oktober 2010
More ...




dinsdag 12 oktober 2010
More ...

               •     There is much more in
                     Symfony2




dinsdag 12 oktober 2010
More ...

               •     There is much more in
                     Symfony2

                    •     CssSelector




dinsdag 12 oktober 2010
More ...

               •     There is much more in
                     Symfony2

                    •     CssSelector

                    •     DomCrawler




dinsdag 12 oktober 2010
More ...

               •     There is much more in
                     Symfony2

                    •     CssSelector

                    •     DomCrawler

                    •     Form




dinsdag 12 oktober 2010
Integration


               • No need to limit yourself
               • Pick the right base
               • Use external resources


dinsdag 12 oktober 2010
Component Frameworks
               • Zend Framework
               • Symfony Components
               • Zeta Components
               • PEAR
               • Prado
               • Solar
               • many more ...
dinsdag 12 oktober 2010
Questions?



dinsdag 12 oktober 2010
• http://www.leftontheweb.com/
               • http://www.stefankoopmanschap.com/
               • http://twitter.com/skoop
               • http://slideshare.net/skoop
               • http://joind.in/talk/view/2199

dinsdag 12 oktober 2010

More Related Content

More from Stefan Koopmanschap

Would you like docs with that? - Zend Webinar
Would you like docs with that? - Zend WebinarWould you like docs with that? - Zend Webinar
Would you like docs with that? - Zend WebinarStefan Koopmanschap
 
Git workshop (2value, 14-12-2010)
Git workshop (2value, 14-12-2010)Git workshop (2value, 14-12-2010)
Git workshop (2value, 14-12-2010)Stefan Koopmanschap
 
Would you like docs with that? (IPC 2010)
Would you like docs with that? (IPC 2010)Would you like docs with that? (IPC 2010)
Would you like docs with that? (IPC 2010)Stefan Koopmanschap
 
Would you like docs with that? (IPC 2010)
Would you like docs with that? (IPC 2010)Would you like docs with that? (IPC 2010)
Would you like docs with that? (IPC 2010)Stefan Koopmanschap
 
Would you like docs with that? (Pfcongres 2010)
Would you like docs with that? (Pfcongres 2010)Would you like docs with that? (Pfcongres 2010)
Would you like docs with that? (Pfcongres 2010)Stefan Koopmanschap
 
The Symfony Community - How to (get) help
The Symfony Community - How to (get) helpThe Symfony Community - How to (get) help
The Symfony Community - How to (get) helpStefan Koopmanschap
 
Integrating symfony and Zend Framework (PHPBarcelona 2009)
Integrating symfony and Zend Framework (PHPBarcelona 2009)Integrating symfony and Zend Framework (PHPBarcelona 2009)
Integrating symfony and Zend Framework (PHPBarcelona 2009)Stefan Koopmanschap
 
Integrating symfony and Zend Framework (PHPNW09)
Integrating symfony and Zend Framework (PHPNW09)Integrating symfony and Zend Framework (PHPNW09)
Integrating symfony and Zend Framework (PHPNW09)Stefan Koopmanschap
 
Integrating symfony and Zend Framework
Integrating symfony and Zend FrameworkIntegrating symfony and Zend Framework
Integrating symfony and Zend FrameworkStefan Koopmanschap
 
5 essential tools for the PHP Developer on Windows
5 essential tools for the PHP Developer on Windows5 essential tools for the PHP Developer on Windows
5 essential tools for the PHP Developer on WindowsStefan Koopmanschap
 
The Power Of Refactoring (php|tek 09)
The Power Of Refactoring (php|tek 09)The Power Of Refactoring (php|tek 09)
The Power Of Refactoring (php|tek 09)Stefan Koopmanschap
 
Myphp-busters: symfony framework (php|tek 09)
Myphp-busters: symfony framework (php|tek 09)Myphp-busters: symfony framework (php|tek 09)
Myphp-busters: symfony framework (php|tek 09)Stefan Koopmanschap
 
The Power Of Refactoring (PHPCon Italia)
The Power Of Refactoring (PHPCon Italia)The Power Of Refactoring (PHPCon Italia)
The Power Of Refactoring (PHPCon Italia)Stefan Koopmanschap
 
Myphp-busters: symfony framework (PHPCon.it)
Myphp-busters: symfony framework (PHPCon.it)Myphp-busters: symfony framework (PHPCon.it)
Myphp-busters: symfony framework (PHPCon.it)Stefan Koopmanschap
 
The Power Of Refactoring (4developers Krakow)
The Power Of Refactoring (4developers Krakow)The Power Of Refactoring (4developers Krakow)
The Power Of Refactoring (4developers Krakow)Stefan Koopmanschap
 
Myphp-busters: symfony framework
Myphp-busters: symfony frameworkMyphp-busters: symfony framework
Myphp-busters: symfony frameworkStefan Koopmanschap
 
The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)Stefan Koopmanschap
 

More from Stefan Koopmanschap (20)

Would you like docs with that? - Zend Webinar
Would you like docs with that? - Zend WebinarWould you like docs with that? - Zend Webinar
Would you like docs with that? - Zend Webinar
 
Git workshop (2value, 14-12-2010)
Git workshop (2value, 14-12-2010)Git workshop (2value, 14-12-2010)
Git workshop (2value, 14-12-2010)
 
Git Workshop (Pfz Workshopdag)
Git Workshop (Pfz Workshopdag)Git Workshop (Pfz Workshopdag)
Git Workshop (Pfz Workshopdag)
 
Would you like docs with that? (IPC 2010)
Would you like docs with that? (IPC 2010)Would you like docs with that? (IPC 2010)
Would you like docs with that? (IPC 2010)
 
Would you like docs with that? (IPC 2010)
Would you like docs with that? (IPC 2010)Would you like docs with that? (IPC 2010)
Would you like docs with that? (IPC 2010)
 
symfony 1.4 workshop
symfony 1.4 workshopsymfony 1.4 workshop
symfony 1.4 workshop
 
Would you like docs with that? (Pfcongres 2010)
Would you like docs with that? (Pfcongres 2010)Would you like docs with that? (Pfcongres 2010)
Would you like docs with that? (Pfcongres 2010)
 
The Symfony Community - How to (get) help
The Symfony Community - How to (get) helpThe Symfony Community - How to (get) help
The Symfony Community - How to (get) help
 
Integrating symfony and Zend Framework (PHPBarcelona 2009)
Integrating symfony and Zend Framework (PHPBarcelona 2009)Integrating symfony and Zend Framework (PHPBarcelona 2009)
Integrating symfony and Zend Framework (PHPBarcelona 2009)
 
Integrating symfony and Zend Framework (PHPNW09)
Integrating symfony and Zend Framework (PHPNW09)Integrating symfony and Zend Framework (PHPNW09)
Integrating symfony and Zend Framework (PHPNW09)
 
Integrating symfony and Zend Framework
Integrating symfony and Zend FrameworkIntegrating symfony and Zend Framework
Integrating symfony and Zend Framework
 
Scrum (dutch)
Scrum (dutch)Scrum (dutch)
Scrum (dutch)
 
5 essential tools for the PHP Developer on Windows
5 essential tools for the PHP Developer on Windows5 essential tools for the PHP Developer on Windows
5 essential tools for the PHP Developer on Windows
 
The Power Of Refactoring (php|tek 09)
The Power Of Refactoring (php|tek 09)The Power Of Refactoring (php|tek 09)
The Power Of Refactoring (php|tek 09)
 
Myphp-busters: symfony framework (php|tek 09)
Myphp-busters: symfony framework (php|tek 09)Myphp-busters: symfony framework (php|tek 09)
Myphp-busters: symfony framework (php|tek 09)
 
The Power Of Refactoring (PHPCon Italia)
The Power Of Refactoring (PHPCon Italia)The Power Of Refactoring (PHPCon Italia)
The Power Of Refactoring (PHPCon Italia)
 
Myphp-busters: symfony framework (PHPCon.it)
Myphp-busters: symfony framework (PHPCon.it)Myphp-busters: symfony framework (PHPCon.it)
Myphp-busters: symfony framework (PHPCon.it)
 
The Power Of Refactoring (4developers Krakow)
The Power Of Refactoring (4developers Krakow)The Power Of Refactoring (4developers Krakow)
The Power Of Refactoring (4developers Krakow)
 
Myphp-busters: symfony framework
Myphp-busters: symfony frameworkMyphp-busters: symfony framework
Myphp-busters: symfony framework
 
The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)
 

Integrating symfony and Zend Framework (IPC 2010)