views:

722

answers:

2

I've noticed that the sames happens with:

$moduleLoader = new Zend_Application_Module_Autoloader(array(
        'namespace' => '', 
        'basePath'  => APPLICATION_PATH));
$moduleLoader->addResourceType('acl','acls/','Acl');

and

$resourceLoader = new Zend_Loader_Autoloader_Resource(array(
'basePath'  => APPLICATION_PATH,
'namespace' => '',
));
$resourceLoader->addResourceType('acl', 'acls', 'Acl')

In fact, what's the difference?

+1  A: 

This might give you start. I'm still looking for better differences.

Zend_Application_Module_Autoloader provides the functionality needed to map the various resources under a module to the appropriate directories, and provides a standard naming mechanism as well.

Zend_Loader_Autoloader_Resource is intended to simplify loading resources that do not have 1:1 class prefix/filesystem mappings. The primary use case is for use with modular applications, to allow autoloading of module-specific classes.

Look at this page. It might be able to give you some insight.


From what I can see, Zend_Application_Module_Autoloader is basically the Resource with predefined mappings, giving you a directory structure to start out with.

Chacha102
A: 

The module autloader is a type of autoloader resource specific for modules and applies the module name as part of the namespace and sets up the default resources types expected by Zend conventions automagically.

prodigitalson