PhpRiot
News Archive
PhpRiot Newsletter
Your Email Address:

More information

Court Ewing's Blog: Zend Framework Modules: Autoloading & Namespaces

Note: This article was originally published at PHPDeveloper on 7 July 2010.
PHPDeveloper

Court Ewing has written up a new post about using Zend Framework modules and things you need to worry about with considering autoloading and namespacing them correctly.

Modules are natively supported in Zend Framework, but their implementation is not conducive to flexible autoloading nor the use of namespaces in PHP 5.3. There may be a few contributors out there that will defend the current implementation of module autoloading, but throughout the development lifecycle of the current Model-View-Controller implementation in the framework, poor design decisions have made working with modules less flexible and more frustrating.

Because of these poor decisions there are a few problems that you'll need to overcome when using modules, specifically in dealing with naming conventions currently in place in the framework and how that can make autoloading more difficult. He has a concept he's worked up to try to help the situation - Expia, a system for fully namespacing out modules so a simple directory structure correctly reflects the namespacing.