0
twitter: @akrabatZend Framework 2.0   Whatʼs new?         Rob Allen     ConFoo March 2011
Rob Allen?•   PHP developer since 1999•   Wrote Zend_Config•   Tutorial at akrabat.com•   Zend Framework in Action!Next boo...
Zend Framework 1.0
How we got here• Announced October 2005• Mar 2006: v0.1 released: not a lot!• July 2007: v1.0: MVC + cool stuff!• Mar 2008...
Where we are today• Zend Framework 1 core is complete• New components, adapters and plugins  are being added• Widespread u...
Problems with ZF1• Learning curve• Performance• Too much “magic”• Inconsistency between components
Zend Framework 2.0 “The primary thrust of ZF 2.0 is to make a more consistent, well-documented product, improvingdeveloper...
Think evolution, not revolution
Zend Framework 2   Key goals
Ease learning curve• Create better documentation • Cohesive tutorials • Reference manual• Address API consistency • Option...
Easier extension• Remove singletons• Interfaces over abstract classes• Remove hard-coded dependancies
Improve performance• Aiming for 200%+ over ZF 1• Deployment tools • Optimise for production• Documentation
Simplify• Focus on core components• Make code readable• Consistent APIs
Zend Framework 2  Key changes
“The general theme throughout these milestones is narrowing the scope of components, and ensuring a proper   separation of...
PHP 5.3 support• Advance the use of PHP 5.3• Namespaces• Closures over create_function()
Namespaces// library/Nennius/Controller/Plugin/InitAdminLayout.php<?phpnamespace NenniusControllerPlugin;use ZendControlle...
Autoloading• No more include path• Standard autoloader • Explicit namespace=>path pairs • up to 40% performance gain!• 2: ...
Plugin loading• Alias autoloading • map ʻaliasʼ to class that it represents • Interface for consistency (clients)• Plugin ...
Plugin loading$broker = new ZendViewHelperBroker();$loader = $broker->getPluginLoader();$loader->register(url, MyViewHelpe...
Exception handling• Use SPL exceptions for specific catches• Use an interface for component catches• Can catch Exception if...
Exceptionsnamespace My;interface ExceptionInterface {}class Exception implements ExceptionInterface {}class InvalidArgumen...
MVC• Will write to the interface!• Modules as 1st class citizens• Page controllers• Service Locator with DI• Standardise h...
Internationalisation• Improve performance• Use DateTime• Fix inconsistencies with PHPʼs APIs• Remove statics and global st...
Zend Framework 2Development process
git• Smaller barrier to contribution• Better branching and merging• ZFʼs git guide: http://bit.ly/zfgit
Unit testing• Write to /tmp only• Separate out test asset classes• Consistent usage of _files directory• Lower memory/CPU u...
Community Review team• Smooth the proposal process• Assist new contributors• “Fix” orphaned components• Contact: •   IRC: ...
Milestones• Autoloading & plugin loading [done]• Exceptions [done]• MVC [in progress]• Testing• Documentation [proposals i...
When?
I have no idea!
Summary
• Play with the ZF2 snapshots• Contribute    •   Report bugs!    •   Comment on proposals: http://bit.ly/zf2wiki• Need hel...
Questions?      feedback: http://joind.in/2854          email: rob@akrabat.com                  twitter: @akrabat
Thank you      feedback: http://joind.in/2854          email: rob@akrabat.com                  twitter: @akrabat
Upcoming SlideShare
Loading in...5
×

Zend Framework 2, What's new, Confoo 2011

2,019

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,019
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
44
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Zend Framework 2, What's new, Confoo 2011"

  1. 1. twitter: @akrabatZend Framework 2.0 Whatʼs new? Rob Allen ConFoo March 2011
  2. 2. Rob Allen?• PHP developer since 1999• Wrote Zend_Config• Tutorial at akrabat.com• Zend Framework in Action!Next book! Zend Framework 2 in Action (with Ryan Mauger)
  3. 3. Zend Framework 1.0
  4. 4. How we got here• Announced October 2005• Mar 2006: v0.1 released: not a lot!• July 2007: v1.0: MVC + cool stuff!• Mar 2008: v1.5: Form, Layout, Context• Apr 2009: v1.8: Application, Tool, Nav• Nov 2010: v1.11: SimpleCloud, UserAgent
  5. 5. Where we are today• Zend Framework 1 core is complete• New components, adapters and plugins are being added• Widespread usage• Plenty of help available
  6. 6. Problems with ZF1• Learning curve• Performance• Too much “magic”• Inconsistency between components
  7. 7. Zend Framework 2.0 “The primary thrust of ZF 2.0 is to make a more consistent, well-documented product, improvingdeveloper productivity and runtime performance.” Matthew Weier OʼPhinney
  8. 8. Think evolution, not revolution
  9. 9. Zend Framework 2 Key goals
  10. 10. Ease learning curve• Create better documentation • Cohesive tutorials • Reference manual• Address API consistency • Options • Language
  11. 11. Easier extension• Remove singletons• Interfaces over abstract classes• Remove hard-coded dependancies
  12. 12. Improve performance• Aiming for 200%+ over ZF 1• Deployment tools • Optimise for production• Documentation
  13. 13. Simplify• Focus on core components• Make code readable• Consistent APIs
  14. 14. Zend Framework 2 Key changes
  15. 15. “The general theme throughout these milestones is narrowing the scope of components, and ensuring a proper separation of concerns between components.” Matthew Weier O’Phinney
  16. 16. PHP 5.3 support• Advance the use of PHP 5.3• Namespaces• Closures over create_function()
  17. 17. Namespaces// library/Nennius/Controller/Plugin/InitAdminLayout.php<?phpnamespace NenniusControllerPlugin;use ZendControllerRequestAbstractRequest as Request;use ZendControllerPluginAbstractPlugin as Plugin;class InitAdminLayout extends Plugin{ public function dispatchLoopStartup(Request $request) { $fc = ZendControllerFront::getInstance(); $bootstrap = $fc->getParam(bootstrap); $layout = $bootstrap->layout; $controllerName = $request->getControllerName(); if (substr($controllerName, 0, 5) == admin) { $layout->setLayout(admin); }}
  18. 18. Autoloading• No more include path• Standard autoloader • Explicit namespace=>path pairs • up to 40% performance gain!• 2: ClassMap autoloader • pre-built array map (for deployment) • up to 150% performance gain!
  19. 19. Plugin loading• Alias autoloading • map ʻaliasʼ to class that it represents • Interface for consistency (clients)• Plugin broker (central operations)• Mapping is simpler to explain!• Much more performant! (up to 5x!)
  20. 20. Plugin loading$broker = new ZendViewHelperBroker();$loader = $broker->getPluginLoader();$loader->register(url, MyViewHelperUrl);// get a ZendViewHelperBaseUrl$baseUrlHelper = $broker->load(baseUrl);// get a MyViewHelperUrl$urlHelper = $broker->load(url);
  21. 21. Exception handling• Use SPL exceptions for specific catches• Use an interface for component catches• Can catch Exception if you donʼt care :)
  22. 22. Exceptionsnamespace My;interface ExceptionInterface {}class Exception implements ExceptionInterface {}class InvalidArgument extends InvalidArgumentException implements ExceptionInterface {}try { $a = new A(); $a->b($c);}catch (InvalidArgument $e) { die("Invalid arg happenedn");}catch (ExceptionInterface $e) { die("Some error happenedn");}
  23. 23. MVC• Will write to the interface!• Modules as 1st class citizens• Page controllers• Service Locator with DI• Standardise hooks• View
  24. 24. Internationalisation• Improve performance• Use DateTime• Fix inconsistencies with PHPʼs APIs• Remove statics and global states
  25. 25. Zend Framework 2Development process
  26. 26. git• Smaller barrier to contribution• Better branching and merging• ZFʼs git guide: http://bit.ly/zfgit
  27. 27. Unit testing• Write to /tmp only• Separate out test asset classes• Consistent usage of _files directory• Lower memory/CPU usage
  28. 28. Community Review team• Smooth the proposal process• Assist new contributors• “Fix” orphaned components• Contact: • IRC: #zftalk.dev on freenode • Email: cr-team@zend.com
  29. 29. Milestones• Autoloading & plugin loading [done]• Exceptions [done]• MVC [in progress]• Testing• Documentation [proposals in place]• Internationalisation
  30. 30. When?
  31. 31. I have no idea!
  32. 32. Summary
  33. 33. • Play with the ZF2 snapshots• Contribute • Report bugs! • Comment on proposals: http://bit.ly/zf2wiki• Need help? • IRC: #zftalk on freenode • Mailing list• Buy Zend Framework 2 in Action (when released!)
  34. 34. Questions? feedback: http://joind.in/2854 email: rob@akrabat.com twitter: @akrabat
  35. 35. Thank you feedback: http://joind.in/2854 email: rob@akrabat.com twitter: @akrabat
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×