My final proposal would be to add all controller directories to be searched just before the dispatch step/process part, and not exactly after calling the addModuleDirectory() method. I think this won't break anything (existing applications). If this would break, it is possible to add another method X, called by addModuleDirectory(), just with the difference: addModuleDirectory would add imediatlly the controller directories, and the X method, would add them just before the dispatch process. Thanks
--- On Sun, 10/4/09, Andrei Iarus <[email protected]> wrote: From: Andrei Iarus <[email protected]> Subject: Re: [fw-general] FrontController set controller directory and SetModule Directory order:bug? To: "Zend Framework" <[email protected]> Cc: "Jurian Sluiman" <[email protected]> Date: Sunday, October 4, 2009, 11:59 PM Thank you for reply. The problem is that I don't see the method setModuleDirectory in the Zend/Controller/Front.php file, so that I cannot test it. Thanks --- On Sun, 10/4/09, Jurian Sluiman <[email protected]> wrote: From: Jurian Sluiman <[email protected]> Subject: Re: [fw-general] FrontController set controller directory and SetModule Directory order:bug? To: [email protected] Date: Sunday, October 4, 2009, 7:54 PM #yiv2096487821 #yiv586160638 p, #yiv2096487821 #yiv586160638 li {white-space:pre-wrap;} Hi Andrei, Do you use addModuleDirectory() for a specific reason? If you can use setModuleDirectory, than it's no problem for the sequence. If you look at the Zend_Controller_Front::addModuleDirectory() method, you find it's iterating that directory, searching for a controller directory (by Zend_Controller_Front::getModuleControllerDirectoryName()), and adding the controller directory path for that module. If you don't specify the module controller directory name, the function will use the earlier specified name (and if it's not set, probably the default value). So yes: it's expected behaviour :) Regards, Jurian -- Jurian Sluiman Soflomo.com Op Sunday 04 October 2009 13:17:46 schreef Andrei Iarus: > Hello, > > I have found a bug related to the order of executing (in bootstrap.php) of > the Front Controller's (FC) setModuleControllerDirectoryName method > and of the FC's addModuleDirectory method. > > In this case: > $frontController->addModuleDirectory(APPLICATION_PATH . '/modules'); > $frontController->setModuleControllerDirectoryName('admin/controllers'); > > the correct Controller directory simply won't be used. If the other > sequence is used, everything works just fine. Tested under version 1.9.2. > Mainly, my question is: is this the desired behaviour or just a bug? If > desired behaviour, why? > Thanks.
