w swoim cmsie opartym o ZF zastosowałem poniższe rozwiązanie,
w przyszłości zamierzam napisać własny autoloader odpowiadający mojej strukturze projektu
protected function _initAutoload()
{
$autoloader = new Zend_Application_Module_Autoloader
(array( 'namespace' => '',
));
$autoloader->addResourceTypes(array( 'namespace' => 'Zadoo_',
'path' => '/lib/Zadoo',
)));
$this->bootstrap('frontController');
$this->front = $this->getResource('frontController');
$di = new DirectoryIterator( APPLICATION_PATH . '/modules' );
foreach ($di as $v)
{
if ($v->isDot()) continue;
$this->front -> addControllerDirectory(APPLICATION_PATH . '/modules/'.$v->getFileName().'/controllers', $v->getFileName());
$modul = $v->getFileName();
$restypes[$modul.'dbtable'] = array( 'namespace' => ucfirst($modul).'_Model_DbTable', 'path' => 'modules/'.$modul.'/models/dbtable',
);
$restypes[$modul.'form'] = array( 'namespace' => ucfirst($modul).'_Form', 'path' => 'modules/'.$modul.'/forms',
);
$restypes[$modul.'model'] = array( 'namespace' => ucfirst($modul).'_Model', 'path' => 'modules/'.$modul.'/models',
);
$restypes[$modul.'plugin'] = array( 'namespace' => ucfirst($modul).'_Plugin', 'path' => 'modules/'.$modul.'/plugins',
);
$restypes[$modul.'block'] = array( 'namespace' => ucfirst($modul).'_Block', 'path' => 'modules/'.$modul.'/blocks',
);
$restypes[$modul.'viewhelper'] = array( 'namespace' => ucfirst($modul).'_View_Helper', 'path' => 'modules/'.$modul.'/views/helpers',
);
$restypes[$modul.'viewfilter'] = array( 'namespace' => ucfirst($modul).'_View_Filter', 'path' => 'modules/'.$modul.'/views/filters',
);
}
$autoloader->addResourceTypes($restypes);
return $autoloader;
}