views:

36

answers:

1

I have a ZF application using the standard structure:

application/
    <etc>
library/
    Zend/
public/
tests/

I also have a separate library using the following structure:

library/
    <classes>
tests/
   library/

Both use git for source control. I'd like to include the library in the application, but I'm struggling to find a nice, maintainable way to do this. The contents of the library's 'library' folder are structured so as to be suitable for autoloading, so ideally I want the contents of library/ to exist in the ZF app's library directory:

library/
    Zend/
    <classes>

I can't use git submodules alone, as I can't include a sub-folder of a repo as a submodule, and submodules have to exist in a sub-folder themselves (so I'd end up with library/something/<classes>).

I've been playing with these subtree extensions to git, which are pretty cool, and solve the first problem (by allowing me to split out the library folder of my library project into it's own repo). But I still have the problem of not being to include the contents of this repo into my library folder directly.

I'm trying to avoid adding a whole new folder with autoloading just for this lib.

Does anyone know of a nice solution to this, or does anyone use a slightly different project structure to avoid this?

A: 

have you tried putting the separate library alongside Zend in /library and adding:

autoloaderNamespaces[] = "YourLibName"

To application.ini ? Thats what I would do.

If its not already done also add this to bootstrap:

 protected function _initAppAutoload()
{
    $moduleLoad = new Zend_Application_Module_Autoloader(array(
       'namespace' => '',
       'basePath'   => APPLICATION_PATH
    ));
}
Iznogood
Thanks but it's getting the files into /library that's the issue, as I'm wanting to use git submodules or some other method to allow me to easily keep it up to date.
Tim Fountain