您可以執行在全球引導所需的全部應用程序類和命名空間的自動加載(而不是在模塊具體白手起家):
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
protected function _initAutoloaders()
{
// require/require_once for libs/modules with specific autoloaders
// Load HTML purifier autoloader
require_once 'HTMLPurifier' . DS . 'HTMLPurifier.auto.php';
// Load WideImage
require_once 'WideImage' . DS . 'WideImage.php';
// ...
// Use Zend autoloader for other stuff
$zendAutoloader = Zend_Loader_Autoloader::getInstance();
// Register stuff.
$autoloader = array(new SomeClassLoader('SomeLib', LIB_PATH), 'loadClass');
$zendAutoloader->pushAutoloader($autoloader, 'LibName\\');
// ...
}
// ... Other initializers
}
你可能必須建立一個插件加載的資源[preDispatch()](http://framework.zend.com/manual/en/zend.controller.plugins.html)或更早版本。這樣所有的引導程序將運行 – RockyFord
你目前如何加載你的模塊?通過application.ini中的resources.modules或主引導程序? –