What is the difference between Zend_Application_Module_Autoloader and Zend_Loader_Autoloader_Resource?

I noticed that sames happens to:

$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?

+6
zend-framework
source share
2 answers

This can give you a start. I'm still looking for the best differences.

Zend_Application_Module_Autoloader provides the functionality needed to map various resources in the module to the corresponding directories, and also provides a standard naming mechanism.

Zend_Loader_Autoloader_Resource is designed to simplify loading resources that do not have 1: 1 prefix / file system mappings. The main use case is intended for use with modular applications to allow autoload of module-specific classes.

Check out this page . He could give you some idea.


From what I see, Zend_Application_Module_Autoloader is basically a resource with predefined mappings, which gives you the directory structure you start with.

+3
source share

A module autoloader is a module-specific autoloader resource type and applies the module name as part of the namespace and automatically configures the default resource types expected by Zend conventions.

+3
source share

All Articles