Re: [fw-general] Multiple ControllerDirectory paths
Thanks Matthew Extending the front controller will do the trick nicely. Ditching the multiple directory support in favor of performance is also not something I will complain about :-) The nice thing about ZF is that it can easily be extended, so I'll take that route for this specific project. Thanks again, Werner Matthew Weier O'Phinney wrote: -- Werner <[EMAIL PROTECTED]> wrote (on Thursday, 22 March 2007, 01:44 PM +0200): I want to specify multiple controller directories that should all be searched for controllers. I want to do this without deploying any predefined modular directory structures - just multiple paths for controllers (whether modules will be used or not). However, when specifying any additional directory path it seems like the first path is overwritten by the last specified path. E.g, is it possible to make something like this work...? $controller->throwExceptions(true) ->setRouter($router) ->setBaseUrl($baseUrl) ->setControllerDirectory('/my/first/path') // Default directory ->addControllerDirectory('/my/second/path') // Another directory ->addControllerDirectory('/my/third/path'); // Yet another directory Any ideas, hint or tips on how to achieve this? This functionality was ditched prior to 0.8.0 as it added too much overhead, and won't be added again anytime soon. Basically, keeping track of a stack of directories *per* *module*, and then having to search each *set* of directories for a controller was very resource intensive, for very little benefit. If you need several directories of controllers all in the same namespace, you might want to try using symlinks or consolidating. Alternatively, you can implement your own dispatcher and front controller -- you'd need to override the front controller's add/setControllerDirectory() methods, and the dispatcher's getControllerName() method.
Re: [fw-general] Multiple ControllerDirectory paths
-- Werner <[EMAIL PROTECTED]> wrote (on Thursday, 22 March 2007, 01:44 PM +0200): > I want to specify multiple controller directories that should all be > searched for controllers. I want to do this without deploying any > predefined modular directory structures - just multiple paths for > controllers (whether modules will be used or not). > > However, when specifying any additional directory path it seems like the > first path is overwritten by the last specified path. > > E.g, is it possible to make something like this work...? > > $controller->throwExceptions(true) >->setRouter($router) >->setBaseUrl($baseUrl) >->setControllerDirectory('/my/first/path') // Default > directory >->addControllerDirectory('/my/second/path') // Another > directory >->addControllerDirectory('/my/third/path'); // Yet > another directory > > Any ideas, hint or tips on how to achieve this? This functionality was ditched prior to 0.8.0 as it added too much overhead, and won't be added again anytime soon. Basically, keeping track of a stack of directories *per* *module*, and then having to search each *set* of directories for a controller was very resource intensive, for very little benefit. If you need several directories of controllers all in the same namespace, you might want to try using symlinks or consolidating. Alternatively, you can implement your own dispatcher and front controller -- you'd need to override the front controller's add/setControllerDirectory() methods, and the dispatcher's getControllerName() method. -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
[fw-general] Multiple ControllerDirectory paths
Hi! I want to specify multiple controller directories that should all be searched for controllers. I want to do this without deploying any predefined modular directory structures - just multiple paths for controllers (whether modules will be used or not). However, when specifying any additional directory path it seems like the first path is overwritten by the last specified path. E.g, is it possible to make something like this work...? $controller->throwExceptions(true) ->setRouter($router) ->setBaseUrl($baseUrl) ->setControllerDirectory('/my/first/path') // Default directory ->addControllerDirectory('/my/second/path') // Another directory ->addControllerDirectory('/my/third/path'); // Yet another directory Any ideas, hint or tips on how to achieve this? Thank you for your time, Werner