Ok, I'm frustrated beyond words!
I have a ZF 1.9 application. The following is in my bootstrap.php:
$front = Zend_Controller_Front::getInstance();
$front->addModuleDirectory(dirname(__FILE__).'/modules');
I've put some trace code into the ZF library files, and I can see the call to addModuleDirectory and the subsequent internal call to addControllerDirectory - it's got the right values for the module name and the path. If I dump the internal _controllerDirectory variable (this is all in Library/Controller/Dispatcher/Standard.php, by the way), I can see my module directory.
The next thing my trace shows is that the default controller directory is added for the default controller - perfect.
However, on the next call to dispatch(), I'm again dumping the _controllerDirectory variable and it's only got the default module's controller directory. WTF? I have the trace going to a file... here it is (commented by me):
-- first call, triggered by addModuleDirectory(): Adding 13:09:08 Module itemquestion Path /Users/don/Documents/Aptana Studio Workspace/cahoots2/application/modules/itemquestion/controllers -- You can see my dir is in here... _controllerDirectory contains: 13:09:08 /Users/don/Documents/Aptana Studio Workspace/cahoots2/application/modules/itemquestion/controllers -- second call, triggered internally by ZF: Adding 13:09:08 Module default Path /Users/don/Documents/Aptana Studio Workspace/cahoots2/application/controllers -- Where's my directory???? _controllerDirectory contains: 13:09:08 /Users/don/Documents/Aptana Studio Workspace/cahoots2/application/controllers
What in the world am I doing wrong? Why can't I get my module's directory to stay persistent?
EDIT: Some additional detail. I added a second module to the /modules folder. Now, I can see the first module being added and showing up in the _controllerDirectory variable. Then, I can see the second added, and see BOTH of them in the variable. Then I see the default module added and after that call, it's the only thing in _controllerDirectory.