integrating symfony and zend framework (ipc 2010)
DESCRIPTION
The slides of my presentation on integrating symfony and Zend Framework, as presented at International PHP Conference 2010 in Mainz on October 12TRANSCRIPT
Integratingsymfony 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
symfonydinsdag 12 oktober 2010
Zend Frameworkdinsdag 12 oktober 2010
integratedinsdag 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
Indexdinsdag 12 oktober 2010
Indexdinsdag 12 oktober 2010
Indexdinsdag 12 oktober 2010
Indexdinsdag 12 oktober 2010
Indexdinsdag 12 oktober 2010
Searchdinsdag 12 oktober 2010
Searchdinsdag 12 oktober 2010
Searchdinsdag 12 oktober 2010
Searchdinsdag 12 oktober 2010
Searchdinsdag 12 oktober 2010
Searchdinsdag 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 updinsdag 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
YAMLdinsdag 12 oktober 2010
YAMLdinsdag 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
Event Dispatcher
bootstrap code based on http://www.survivethedeepend.com/
dinsdag 12 oktober 2010
Event Dispatcherdinsdag 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 Injectiondinsdag 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