Issues

ZF-3312: CLONE -Module name mapping from URI to directory

Description

Not sure if case-sensitive comparison is an intentional behavior; if it is, would it make sense to add an extra argument to allow mapping the module name case-insensitively from the URI to the physical module directory on the file system?


$zcf = Zend_Controller_Front::getInstance();

$zcf->setParam('noViewRenderer', true);
$zcf->setParam('prefixDefaultModule', true);
$zcf->setModuleControllerDirectoryName('.');
$zcf->addModuleDirectory('/path/to/module/directory');
$zcf->dispatch();

module/
|-- default/
|   |-- ErrorController.php
|   `-- IndexController.php
`-- module1/
    `-- IndexController.php

http://somewhere/module1 hits the IndexController in the module1 directory http://somewhere/Module1 hits the ErrorController in the default module directory

Some users type everything capitalized, and since MODULE1 !== module1 (I'm gussing isValidModule() returns false); the request doesn't go to the intended controller.

If this is an intentional behavior; what's the best way to overcome this? Create a custom dispatcher, or perhaps this can be worked around by configuring the router?

Eric

Comments

isValidModule() now returns true; however,

It seems Zend_Controller_Dispatcher_Standard::_curDirectory gets a wrong value: When tested with all caps: Value is /path/to/the/default/module/directory // wrong When tested with all lower case: Value is /path/to/the/correct/module/directory // correct

When tested with all caps: $dispatchDir in Zend_Controller_Dispatcher_Standard::isDispatchable() is NULL // wrong When tested with all lower case: $dispatchDir in Zend_Controller_Dispatcher_Standard::isDispatchable() is /path/to/the/module/directory // correct

You can extend the dispatcher and router to achieve this functionality; we do not plan to support it directly, however.