Magento - a Zend Framework Application

16,929 views

Published on

Talk by Dmitriy Soroka at ZendCon 2009

Published in: Technology
2 Comments
8 Likes
Statistics
Notes
No Downloads
Views
Total views
16,929
On SlideShare
0
From Embeds
0
Number of Embeds
52
Actions
Shares
0
Downloads
457
Comments
2
Likes
8
Embeds 0
No embeds

No notes for slide

Magento - a Zend Framework Application

  1. 1. ZendCon 2009 Nov 4, 2009 | | Magento – a Zend Framework application By Dmitriy Soroka System Architect at Varien
  2. 2. Magento Nov 4, 2009 | |
  3. 3. Magento today <ul><li>1,000,000+ downloads </li></ul><ul><li>~70 core modules in Community Edition </li></ul><ul><li>and ~20 in Enterprise Edition </li></ul><ul><li>Magento Core Team </li></ul><ul><li>Magento community </li></ul><ul><li>Magento connect </li></ul>Nov 4, 2009 | |
  4. 4. Magento under the hood <ul><li>PHP 5 </li></ul><ul><li>OOP (MVC) </li></ul><ul><li>Zend Framework </li></ul><ul><li>Modular Architecture </li></ul>Nov 4, 2009 | |
  5. 5. Nov 4, 2009 | | Select Magento Platform Frameworks CMS/CMF Systems E-Commerce <ul><li>Zend Framework </li></ul><ul><li>CakePHP </li></ul><ul><li>CodeIgniter </li></ul><ul><li>Symfony </li></ul><ul><li>etc. </li></ul><ul><li>Joomla </li></ul><ul><li>Drupal </li></ul><ul><li>EZ Publisher </li></ul><ul><li>Mambo </li></ul><ul><li>etc. </li></ul><ul><li>osCommerce </li></ul><ul><li>VirtueMart </li></ul><ul><li>Zen-Cart </li></ul><ul><li>xCart </li></ul><ul><li>etc. </li></ul>
  6. 6. <ul><li>MVC architecture </li></ul><ul><li>Good documentation </li></ul><ul><li>Robust functionality </li></ul><ul><li>Comunity </li></ul><ul><li>Zend - the PHP company </li></ul><ul><li>Fast growth </li></ul><ul><li>PHP applications standard </li></ul><ul><li>ZF based application provides clear understanding for PHP developers </li></ul><ul><li>Clear development process and ability to contribute custom components </li></ul>Nov 4, 2009 | | Going with the Zend Framework
  7. 7. <ul><li>Application Level Components </li></ul><ul><li>Zend_Controller, Zend_View, Zend_Layout, Zend_Form etc. </li></ul><ul><li>Localization/Internationalization Level Components </li></ul><ul><li>Zend_Locale, Zend_Date, Zend_Currency, Zend_ Measure, Zend_Translate </li></ul><ul><li>Data Level Components </li></ul><ul><li>Zend_Db, Zend_Dom, Zend_Feed, Zend_Search etc. </li></ul><ul><li>Services </li></ul><ul><li>Zend_Gdata, Zend_Services, Zend_Soap etc. </li></ul>Nov 4, 2009 | | Zend Framework Functionality
  8. 8. <ul><li>Zend_Controller </li></ul><ul><li>Zend_View </li></ul><ul><li>Zend_Config </li></ul><ul><li>Zend_Application (since 1.8.0!) </li></ul>Nov 4, 2009 | | ZF components currently not used in Magento
  9. 9. <ul><li>Support multiple module routing </li></ul><ul><li>Internal URL rewrite logic </li></ul><ul><li>http://domain.com/product.html => catalog/product/view/id/1 </li></ul><ul><li>Additional entry points </li></ul><ul><li>Magento events </li></ul>Nov 4, 2009 | | Magento Controller
  10. 10. Nov 4, 2009 | | View level: Page Layout
  11. 11. Nov 4, 2009 | | View level: Blocks page structure
  12. 12. Nov 4, 2009 | | View level: Multiple themes support
  13. 13. <ul><li>About 15 ZF components are currently used </li></ul><ul><li>We plan to use ~10 more components </li></ul><ul><li>Goal – to use as many native ZF components as possible </li></ul>Nov 4, 2009 | | ZF components used in Magento
  14. 14. Nov 4, 2009 | | Zend_Acl
  15. 15. <ul><li>Files </li></ul><ul><li>APC (shared memory) </li></ul><ul><li>Memcached </li></ul><ul><li>eAccelerator </li></ul><ul><li>Xcache </li></ul><ul><li>ZendPlatform </li></ul><ul><li>ZendServer </li></ul>Nov 4, 2009 | | Zend_Cache: backend models
  16. 16. Nov 4, 2009 | | Zend_Cache: single server installation
  17. 17. Nov 4, 2009 | | Zend_Cache: multiple frontends
  18. 18. <ul><li>Zend_Db_Adapter </li></ul><ul><li>Allows for integrating with different DB storage </li></ul><ul><li>Simplifies data managing operations </li></ul><ul><li>Zend_Db_Select </li></ul>Nov 4, 2009 | | Zend_Db
  19. 19. Nov 4, 2009 | | Zend_Locale, Zend_Date, Zend_Currency
  20. 20. Nov 4, 2009 | | Multiple locales support
  21. 21. <ul><li>Zend_Pdf </li></ul><ul><li>Zend_Feed </li></ul><ul><li>Zend_Mail </li></ul><ul><li>Zend_Validate </li></ul><ul><li>Zend_Filter </li></ul>Nov 4, 2009 | | Other ZF components in Magento
  22. 22. Nov 4, 2009 | | Coming Soon <ul><li>Zend_Application </li></ul><ul><li>Zend_Crypt </li></ul><ul><li>Zend_Form </li></ul><ul><li>Zend_Layout </li></ul><ul><li>Zend_Measure </li></ul><ul><li>Zend_Navigation </li></ul><ul><li>Zend_Paginator </li></ul><ul><li>Zend_Tag </li></ul><ul><li>… </li></ul>
  23. 23. Nov 4, 2009 | | Zend_Form <ul><li>Customer attributes as form fields </li></ul><ul><li>Form validation and filtering is easy </li></ul><ul><li>Integration with display logic </li></ul>
  24. 24. Nov 4, 2009 | | ZF application and Magento Application ZF Application Magento Application application/         configs/         controllers/         layouts/         models/         modules/         services/         views/         Bootstrap.php data/         locales/         uploads/ library/ public/         css/         images/         js/         .htaccess         index.php scripts/         jobs/         build/ temp/ tests/ app/ code/ community/ core/ Mage/ .. modules local/ design/ adminhtml/ frontend/ install/ etc/ locale/ js/ lib/ Varien/ Zend/ media/ skin/ adminhtml/ frontend/ install/ var /
  25. 25. Nov 4, 2009 | | ZF Module and Magento module structure ZF Module Magento Module <modulename>     configs/     controllers/     forms/     layouts/         filters/         helpers/         scripts/     models/     services/     views/         filters/         helpers/         scripts/     Bootstrap.php <modulename> Block/ controllers/ etc/ Helper/ Model/ Sql/
  26. 26. Nov 4, 2009 | | Module Dependency
  27. 27. <ul><li>Dependency is specified in module declaration (app/etc/modules/*.xml) </li></ul><ul><li>Dependency determines the order in which the database is built/updated </li></ul><ul><li>Example: </li></ul><ul><li> <config>     <modules>         <Mage_Bundle>             <active>true</active>             <codePool>core</codePool>             <depends>                 <Mage_Catalog />             </depends>         </Mage_Bundle>     </modules> </config> </li></ul>Nov 4, 2009 | | Module Dependency
  28. 28. Nov 4, 2009 | | Module Installation and Upgrade
  29. 29. <ul><li>Code Pools </li></ul><ul><li>/app/code/ </li></ul><ul><li>core/ </li></ul><ul><li>community/ </li></ul><ul><li>local/ </li></ul><ul><li>Configuration </li></ul><ul><li>models, blocks, helpers </li></ul><ul><li> </li></ul>Nov 4, 2009 | | Overwriting Magento
  30. 30. <ul><li>Class overwriting (Model Example) </li></ul><ul><li>Create new module </li></ul><ul><ul><li>(Ex: local/MyProject/MyModule) </li></ul></ul><ul><li>Create class for your model customization </li></ul><ul><ul><li>(Ex: MyProject_MyModule_Model_Customer extends Mage_Customer_Model_Customer) </li></ul></ul><ul><li>Add overwriting instructions to config.xml </li></ul><ul><li><config>             <global>                 <models>                     <customer>                          <rewrite>                             <customer>MyProject_MyModule_Model_Customer</customer>                         </rewrite> </li></ul><ul><li>Overwrite needed methods in your class </li></ul><ul><li>Now Mage::getModel('customer/customer')   => </li></ul><ul><li>new MyProject_MyModule_Model_Customer </li></ul>Nov 4, 2009 | | Overwriting Core Model
  31. 31. Nov 4, 2009 | | http://www.magentocommerce.com [email_address]

×