import v1.1.0_beta1 | 2009-08-21

This commit is contained in:
2019-07-17 22:16:19 +02:00
parent 2c1152f0d3
commit 8dee6b1a10
2306 changed files with 251360 additions and 23428 deletions

View File

@ -15,7 +15,7 @@
* @package Zend_Controller
* @subpackage Router
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @version $Id: Module.php 12310 2008-11-05 20:49:16Z dasprid $
* @version $Id: Module.php 15461 2009-05-09 15:54:21Z dasprid $
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -78,8 +78,13 @@ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_A
*/
public static function getInstance(Zend_Config $config)
{
$defs = ($config->defaults instanceof Zend_Config) ? $config->defaults->toArray() : array();
return new self($defs);
$frontController = Zend_Controller_Front::getInstance();
$defs = ($config->defaults instanceof Zend_Config) ? $config->defaults->toArray() : array();
$dispatcher = $frontController->getDispatcher();
$request = $frontController->getRequest();
return new self($defs, $dispatcher, $request);
}
/**
@ -139,16 +144,20 @@ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_A
* @param string $path Path used to match against this routing map
* @return array An array of assigned values or a false on a mismatch
*/
public function match($path)
public function match($path, $partial = false)
{
$this->_setRequestKeys();
$values = array();
$params = array();
$path = trim($path, self::URI_DELIMITER);
if (!$partial) {
$path = trim($path, self::URI_DELIMITER);
} else {
$matchedPath = $path;
}
if ($path != '') {
$path = explode(self::URI_DELIMITER, $path);
if ($this->_dispatcher && $this->_dispatcher->isValidModule($path[0])) {
@ -172,6 +181,10 @@ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_A
}
}
}
if ($partial) {
$this->setMatchedPath($matchedPath);
}
$this->_values = $values + $params;
@ -185,7 +198,7 @@ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_A
* @param bool $reset Weither to reset the current params
* @return string Route path with user submitted parameters
*/
public function assemble($data = array(), $reset = false, $encode = true)
public function assemble($data = array(), $reset = false, $encode = true, $partial = false)
{
if (!$this->_keysSet) {
$this->_setRequestKeys();