ZF-6552: Zend_Loader_Autoloader_Resource conflicts with Zend_Amf_Server addDirectory()
Cannot match Zend_Autoloader_Resource namespaces with Zend_Amf_Server
$loader = new Zend_Loader_Autoloader_Resource(array( 'basePath' => APPLICATION_PATH, 'namespace' => '', )); $loader->addResourceType('service', '/services', 'Service_'); $loader->addResourceType('dto', '/dtos', 'Dto_'); $loader->setDefaultResourceType('service');
$server = new Zend_Amf_Server(); $server->setProduction(false); $server->addDirectory(APPLICATION_PATH .'/services');
'Service_' namespace set up to map to the /services directory.
class Service_Amf_Files maps to APPLICATION_PATH/services/Amf/Files.php
When a remote AMF call comes in to Service_Amf_Files, Zend_Amf_Server is looking for /services/Service/Amf/Files . This is because the Amf_Server thinks (correctly) that all it's files are in the /services directory, but it doesn't know anything about the Autoloader_Resource and goes ahead with the class naming conventions as if a 'Service' directory actually exists.
From The Framework mailing list: http://nabble.com/Zend_Autoloader_Resource-and-Zen…
"Using Zend_Autoloader_Resource is working great. Except for one thing: matching
the namespaces up with Zend_Amf_Server
If you haven't already, please add an issue to the tracker for this; most likely, it's the autodiscovery code in Zend_Amf_Server that needs to be slightly modified to allow for autoloading.
Matthew Weier O'Phinney"