beberlei / zf-doctrine

A Zend Framework 1.x and Doctrine 1.2 Integration - UNMAINTAINED
101 stars 21 forks source link

Readme suggestion - module autoloading #4

Closed philBrown closed 14 years ago

philBrown commented 14 years ago

You don't need to loop over each module name and add autoloaders if you use the "modules" resource plugin. See http://framework.zend.com/manual/en/zend.application.available-resources.html#zend.application.available-resources.modules

beberlei commented 14 years ago

really? The modules resource plugin does no autoloading from what i can see in the code.

philBrown commented 14 years ago

Just going by the documentation.

Zend_Application_Resource_Modules is used to initialize your application modules. If your module has a Bootstrap.php file in its root, and it contains a class named Module_Bootstrap (where "Module" is the module name), then it will use that class to bootstrap the module. By default, an instance of Zend_Application_Module_Autoloader will be created for the module, using the module name and directory to initialize it.

philBrown commented 14 years ago

Oops, didn't mean to close the issue.

The code appears to be in Zend_Application_Bootstrap_Bootstrap::getResourceLoader() which is called as part of the Bootstrap constructor.

beberlei commented 14 years ago

I'll look into it and see if i can optimize this section. I find the Zend application code hard to understand ;-)