diff -r 2251fb41dbc7 -r 1e110b03ae96 web/lib/Zend/Controller/Dispatcher/Standard.php --- a/web/lib/Zend/Controller/Dispatcher/Standard.php Sun Apr 21 10:07:03 2013 +0200 +++ b/web/lib/Zend/Controller/Dispatcher/Standard.php Sun Apr 21 21:54:24 2013 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Controller * @subpackage Dispatcher - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Standard.php 22038 2010-04-28 18:54:22Z matthew $ + * @version $Id: Standard.php 24861 2012-06-01 23:40:13Z adamlundrigan $ */ /** Zend_Loader */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Controller * @subpackage Dispatcher - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Dispatcher_Standard extends Zend_Controller_Dispatcher_Abstract @@ -257,6 +257,19 @@ } /** + * If we're in a module or prefixDefaultModule is on, we must add the module name + * prefix to the contents of $className, as getControllerClass does not do that automatically. + * We must keep a separate variable because modules are not strictly PSR-0: We need the no-module-prefix + * class name to do the class->file mapping, but the full class name to insantiate the controller + */ + $moduleClassName = $className; + if (($this->_defaultModule != $this->_curModule) + || $this->getParam('prefixDefaultModule')) + { + $moduleClassName = $this->formatClassName($this->_curModule, $className); + } + + /** * Load the controller class file */ $className = $this->loadClass($className); @@ -265,12 +278,12 @@ * Instantiate controller with request, response, and invocation * arguments; throw exception if it's not an action controller */ - $controller = new $className($request, $this->getResponse(), $this->getParams()); + $controller = new $moduleClassName($request, $this->getResponse(), $this->getParams()); if (!($controller instanceof Zend_Controller_Action_Interface) && !($controller instanceof Zend_Controller_Action)) { require_once 'Zend/Controller/Dispatcher/Exception.php'; throw new Zend_Controller_Dispatcher_Exception( - 'Controller "' . $className . '" is not an instance of Zend_Controller_Action_Interface' + 'Controller "' . $moduleClassName . '" is not an instance of Zend_Controller_Action_Interface' ); }