What is the difference between Zend_Application_Module_Autoloader and Zend_Loader_Autoloader_Resource?

StackOverflow https://stackoverflow.com/questions/2152392

  •  23-09-2019
  •  | 
  •  

Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top