-- J DeBord <[email protected]> wrote
(on Tuesday, 05 May 2009, 08:43 AM +0200):
> The autoloading adventure continues...
>
> 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.
Thanks!
> My directory structure is the standard one. Here is some code:
>
> $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');
>
> So I've got the 'Service_' namespace set up to map to the /services directory.
> /services is in the /application (APPLICATION_PATH) directory.
>
> So calling class Service_Amf_Files maps to APPLICATION_PATH/services/Amf/
> Files.php . Great!
>
> BUT, when setting up Zend_Amf_Server like the code above, and adding the /
> services directory to the server, when an AMF call to Service_Amf_Files comes
> in, the 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.
>
> I want to keep my include path as clean as possible. As of right now, there is
> only one directory on it, the library directory. It holds Zend(Framework), and
> a couple other libraries.
>
> So how can you take advantage of the resource autoloader and add a directory
> to
> the Amf_Server? In effect, Amf_Server has it's own autoloader that I can't
> make
> match up with Zend_Autoloader_Resource.
>
> Tips????
>
> Thanks!
>
> J
>
--
Matthew Weier O'Phinney
Project Lead | [email protected]
Zend Framework | http://framework.zend.com/