31
Jun 18, 2022 | 1 | ZendCon 2009 agento – a Zend Framework applicati By Dmitriy Soroka System Architect at Varien

Magento - a Zend Framework Application

  • Upload
    zendcon

  • View
    15.360

  • Download
    1

Embed Size (px)

DESCRIPTION

Talk by Dmitriy Soroka at ZendCon 2009

Citation preview

Page 1: Magento - a Zend Framework Application

Apr 11, 2023 | 1 |

ZendCon 2009

Magento – a Zend Framework application

By Dmitriy SorokaSystem Architect at Varien

Page 2: Magento - a Zend Framework Application

Apr 11, 2023 | 2 |

Magento

Page 3: Magento - a Zend Framework Application

Apr 11, 2023 | 3 |

Magento today

• 1,000,000+ downloads • ~70 core modules in Community Edition and ~20 in Enterprise Edition

• Magento Core Team• Magento community• Magento connect

Page 4: Magento - a Zend Framework Application

Apr 11, 2023 | 4 |

Magento under the hood

• PHP 5• OOP (MVC)• Zend Framework• Modular Architecture

Page 5: Magento - a Zend Framework Application

Apr 11, 2023 | 5 |

Select Magento Platform

Frameworks CMS/CMF Systems E-Commerce

• Zend Framework• CakePHP• CodeIgniter• Symfony• etc.

• Joomla• Drupal• EZ Publisher• Mambo• etc.

• osCommerce• VirtueMart• Zen-Cart• xCart• etc.

Page 6: Magento - a Zend Framework Application

Apr 11, 2023 | 6 |

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

Page 7: Magento - a Zend Framework Application

Apr 11, 2023 | 7 |

Zend Framework Functionality

• Application Level ComponentsZend_Controller, Zend_View, Zend_Layout, Zend_Form etc.

• Localization/Internationalization Level ComponentsZend_Locale, Zend_Date, Zend_Currency, Zend_ Measure, Zend_Translate

• Data Level ComponentsZend_Db, Zend_Dom, Zend_Feed, Zend_Search etc.

• ServicesZend_Gdata, Zend_Services, Zend_Soap etc.

Page 8: Magento - a Zend Framework Application

• Zend_Controller

• Zend_View

• Zend_Config

• Zend_Application (since 1.8.0!)

Apr 11, 2023 | 8 |

ZF components currently not used in Magento

Page 9: Magento - a Zend Framework Application

Apr 11, 2023 | 9 |

Magento Controller

• Support multiple module routing

• Internal URL rewrite logichttp://domain.com/product.html => catalog/product/view/id/1

• Additional entry points Magento events

Page 10: Magento - a Zend Framework Application

Apr 11, 2023 | 10 |

View level: Page Layout

Page 11: Magento - a Zend Framework Application

Apr 11, 2023 | 11 |

View level: Blocks page structure

Page 12: Magento - a Zend Framework Application

Apr 11, 2023 | 12 |

View level: Multiple themes support

Page 13: Magento - a Zend Framework Application

Apr 11, 2023 | 13 |

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

Page 14: Magento - a Zend Framework Application

Apr 11, 2023 | 14 |

Zend_Acl

Page 15: Magento - a Zend Framework Application

Apr 11, 2023 | 15 |

Zend_Cache: backend models

• Files• APC (shared memory)• Memcached

• eAccelerator

• Xcache• ZendPlatform• ZendServer

Page 16: Magento - a Zend Framework Application

Apr 11, 2023 | 16 |

Zend_Cache: single server installation

Page 17: Magento - a Zend Framework Application

Apr 11, 2023 | 17 |

Zend_Cache: multiple frontends

Page 18: Magento - a Zend Framework Application

Apr 11, 2023 | 18 |

Zend_Db

• Zend_Db_AdapterAllows for integrating with different DB storage

Simplifies data managing operations

• Zend_Db_Select

Page 19: Magento - a Zend Framework Application

Apr 11, 2023 | 19 |

Zend_Locale, Zend_Date, Zend_Currency

Page 20: Magento - a Zend Framework Application

Apr 11, 2023 | 20 |

Multiple locales support

Page 21: Magento - a Zend Framework Application

Apr 11, 2023 | 21 |

Other ZF components in Magento

• Zend_Pdf• Zend_Feed• Zend_Mail• Zend_Validate• Zend_Filter

Page 22: Magento - a Zend Framework Application

Apr 11, 2023 | 22 |

Coming Soon

• Zend_Application• Zend_Crypt• Zend_Form• Zend_Layout• Zend_Measure• Zend_Navigation• Zend_Paginator• Zend_Tag• …

Page 23: Magento - a Zend Framework Application

Apr 11, 2023 | 23 |

Zend_Form

• Customer attributes as form fields • Form validation and filtering is easy• Integration with display logic

Page 24: Magento - a Zend Framework Application

Apr 11, 2023 | 24 |

ZF application and Magento Application

ZF Application Magento Applicationapplication/        configs/        controllers/        layouts/        models/        modules/        services/        views/        Bootstrap.phpdata/        locales/        uploads/library/public/        css/        images/        js/        .htaccess        index.phpscripts/        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 /

Page 25: Magento - a Zend Framework Application

Apr 11, 2023 | 25 |

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/

Page 26: Magento - a Zend Framework Application

Apr 11, 2023 | 26 |

Module Dependency

Page 27: Magento - a Zend Framework Application

Apr 11, 2023 | 27 |

Module Dependency

• Dependency is specified in module declaration (app/etc/modules/*.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>

Page 28: Magento - a Zend Framework Application

Apr 11, 2023 | 28 |

Module Installation and Upgrade

Page 29: Magento - a Zend Framework Application

• Code Pools

/app/code/core/community/local/

• Configurationmodels, blocks, helpers

Apr 11, 2023 | 29 |

Overwriting Magento

Page 30: Magento - a Zend Framework Application

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

Apr 11, 2023 | 30 |

Overwriting Core Model

Page 31: Magento - a Zend Framework Application

Apr 11, 2023 | 31 |

http://www.magentocommerce.com

[email protected]