ZendCon 2009

Magento ² a Zend Framework application
By Dmitriy Soroka System Architect at Varien
1 | 29-Sep-10 |

Magento

2 | 29-Sep-10 |

Magento today
‡ 1,000,000+ downloads ‡ ~70 core modules in Community Edition

and ~20 in Enterprise Edition ‡ Magento Core Team ‡ Magento community ‡ Magento connect

3 | 29-Sep-10 |

Magento under the hood ‡ PHP 5 ‡ OOP (MVC) ‡ Zend Framework ‡ Modular Architecture 4 | 29-Sep-10 | .

‡ ‡ E-Commerce osCommerce ‡ VirtueMart ‡ Zen-Cart ‡ xCart ‡ etc. ‡ CMS/CMF Systems Joomla ‡ Drupal ‡ EZ Publisher ‡ Mambo ‡ etc. 5 | 29-Sep-10 | .Select Magento Platform Frameworks Zend Framework ‡ CakePHP ‡ CodeIgniter ‡ Symfony ‡ etc.

Going with the Zend Framework ‡ MVC architecture ‡ Good documentation ‡ Robust functionality ‡ Comunity ‡ Zend .the PHP company ‡ Fast growth ‡ PHP applications standard ZF based application provides clear understanding for PHP developers ‡ Clear development process and ability to contribute custom components 6 | 29-Sep-10 | .

Zend_Layout. Zend_Dom.Zend Framework Functionality ‡ Application Level Components Zend_Controller. Zend_Soap etc. Zend_Translate ‡ Data Level Components Zend_Db. Zend_Currency. Zend_Services. Zend_Form etc. ‡ Localization/Internationalization Level Components Zend_Locale. Zend_Search etc. 7 | 29-Sep-10 | . Zend_View. Zend_Feed. ‡ Services Zend_Gdata. Zend_Date. Zend_ Measure.

ZF components currently not used in Magento ‡ Zend_Controller ‡ Zend_View ‡ Zend_Config ‡ Zend_Application (since 1.0!) 8 | 29-Sep-10 | .8.

html => catalog/product/view/id/1 ‡ Additional entry points Magento events 9 | 29-Sep-10 | .com/product.Magento Controller ‡ Support multiple module routing ‡ Internal URL rewrite logic http://domain.

View level: Page Layout 10 | 29-Sep-10 | .

View level: Blocks page structure 11 | 29-Sep-10 | .

View level: Multiple themes support 12 | 29-Sep-10 | .

ZF components used in Magento ‡ About 15 ZF components are currently used ‡ We plan to use ~10 more components ‡ Goal ± to use as many native ZF components as possible 13 | 29-Sep-10 | .

Zend_Acl 14 | 29-Sep-10 | .

Zend_Cache: backend models ‡ Files ‡ APC (shared memory) ‡ Memcached ‡ eAccelerator ‡ Xcache ‡ ZendPlatform ‡ ZendServer 15 | 29-Sep-10 | .

Zend_Cache: single server installation 16 | 29-Sep-10 | .

Zend_Cache: multiple frontends 17 | 29-Sep-10 | .

Zend_Db ‡ Zend_Db_Adapter Allows for integrating with different DB storage Simplifies data managing operations ‡ Zend_Db_Select 18 | 29-Sep-10 | .

Zend_Date. Zend_Currency 19 | 29-Sep-10 | .Zend_Locale.

Multiple locales support 20 | 29-Sep-10 | .

Other ZF components in Magento ‡ Zend_Pdf ‡ Zend_Feed ‡ Zend_Mail ‡ Zend_Validate ‡ Zend_Filter 21 | 29-Sep-10 | .

Coming Soon ‡ Zend_Application ‡ Zend_Crypt ‡ Zend_Form ‡ Zend_Layout ‡ Zend_Measure ‡ Zend_Navigation ‡ Zend_Paginator ‡ Zend_Tag ‡ « 22 | 29-Sep-10 | .

Zend_Form ‡ Customer attributes as form fields ‡ Form validation and filtering is easy ‡ Integration with display logic 23 | 29-Sep-10 | .

modules local/ design/ adminhtml/ frontend/ install/ etc/ locale/ js/ lib/ Varien/ Zend/ media/ skin/ adminhtml/ frontend/ install/ var / Magento Application 24 | 29-Sep-10 | ..htaccess index.php data/ locales/ uploads/ library/ public/ css/ images/ js/ .ZF application and Magento Application ZF Application application/ configs/ controllers/ layouts/ models/ modules/ services/ views/ Bootstrap.php scripts/ jobs/ build/ temp/ tests/ app/ code/ community/ core/ Mage/ .

php Magento Module <modulename> Block/ controllers/ etc/ Helper/ Model/ Sql/ 25 | 29-Sep-10 | .ZF Module and Magento module structure ZF Module <modulename> configs/ controllers/ forms/ layouts/ filters/ helpers/ scripts/ models/ services/ views/ filters/ helpers/ scripts/ Bootstrap.

Module Dependency 26 | 29-Sep-10 | .

xml) Dependency determines the order in which the database is built/updated Example: <config> <modules> <Mage_Bundle> <active>true</active> <codePool>core</codePool> <depends> <Mage_Catalog /> </depends> </Mage_Bundle> </modules> </config> 27 | 29-Sep-10 | .Module Dependency ‡ ‡ Dependency is specified in module declaration (app/etc/modules/*.

7.7.0 to 0.7.1 «« Upgrade from 0.0 Upgrade from 0.7.Module Installation and Upgrade Install 0.7.6 28 | 29-Sep-10 | .5 to 0.

blocks. helpers 29 | 29-Sep-10 | .Overwriting Magento ‡ Code Pools /app/code/ core/ community/ local/ ‡ Configuration models.

Overwriting Core Model Class overwriting (Model Example) ‡ ‡ Create new module (Ex: local/MyProject/MyModule) Create class for your model customization (Ex: MyProject_MyModule_Model_Customer extends Mage_Customer_Model_Customer) ‡ Add overwriting instructions to config.xml <config> <global> <models> <customer> <rewrite> <customer>MyProject_MyModule_Model_Customer</customer> </rewrite> ‡ ‡ Overwrite needed methods in your class Now Mage::getModel('customer/customer') => new MyProject_MyModule_Model_Customer 30 | 29-Sep-10 | .

com dmitriy@varien.magentocommerce.http://www.com 31 | 29-Sep-10 | .

Sign up to vote on this title
UsefulNot useful