import v2.0.0.0_RC3 | 2012-07-01

https://github.com/lucanos/CommunityID -> http://www.itadmins.net/archives/357
This commit is contained in:
2019-07-17 22:31:04 +02:00
parent 38c146901c
commit 2f397f01f7
2677 changed files with 296182 additions and 45159 deletions

View File

@ -17,7 +17,7 @@
* @subpackage Router
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Interface.php 16541 2009-07-07 06:59:03Z bkarwin $
* @version $Id: Interface.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -39,19 +39,19 @@ interface Zend_Controller_Router_Interface
public function route(Zend_Controller_Request_Abstract $dispatcher);
/**
* Generates a URL path that can be used in URL creation, redirection, etc.
*
* May be passed user params to override ones from URI, Request or even defaults.
* Generates a URL path that can be used in URL creation, redirection, etc.
*
* May be passed user params to override ones from URI, Request or even defaults.
* If passed parameter has a value of null, it's URL variable will be reset to
* default.
*
* default.
*
* If null is passed as a route name assemble will use the current Route or 'default'
* if current is not yet set.
*
* Reset is used to signal that all parameters should be reset to it's defaults.
*
* Reset is used to signal that all parameters should be reset to it's defaults.
* Ignoring all URL specified values. User specified params still get precedence.
*
* Encode tells to url encode resulting path parts.
*
* Encode tells to url encode resulting path parts.
*
* @param array $userParams Options passed by a user used to override parameters
* @param mixed $name The name of a Route to use
@ -61,7 +61,7 @@ interface Zend_Controller_Router_Interface
* @return string Resulting URL path
*/
public function assemble($userParams, $name = null, $reset = false, $encode = true);
/**
* Retrieve Front Controller
*
@ -76,7 +76,7 @@ interface Zend_Controller_Router_Interface
* @return Zend_Controller_Router_Interface
*/
public function setFrontController(Zend_Controller_Front $controller);
/**
* Add or modify a parameter with which to instantiate any helper objects
*
@ -120,5 +120,5 @@ interface Zend_Controller_Router_Interface
* @return Zend_Controller_Router_Interface
*/
public function clearParams($name = null);
}

View File

@ -16,7 +16,7 @@
* @package Zend_Controller
* @subpackage Router
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @version $Id: Rewrite.php 16644 2009-07-11 14:12:17Z dasprid $
* @version $Id: Rewrite.php 18951 2009-11-12 16:26:19Z alexander $
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -40,42 +40,42 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
/**
* Whether or not to use default routes
*
*
* @var boolean
*/
protected $_useDefaultRoutes = true;
/**
* Array of routes to match against
*
*
* @var array
*/
protected $_routes = array();
/**
* Currently matched route
*
*
* @var Zend_Controller_Router_Route_Interface
*/
protected $_currentRoute = null;
/**
* Global parameters given to all routes
*
*
* @var array
*/
protected $_globalParams = array();
/**
* Separator to use with chain names
*
*
* @var string
*/
protected $_chainNameSeparator = '-';
/**
* Add default routes which are used to mimic basic router behaviour
*
*
* @return Zend_Controller_Router_Rewrite
*/
public function addDefaultRoutes()
@ -89,27 +89,27 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
$this->_routes = array_merge(array('default' => $compat), $this->_routes);
}
return $this;
}
/**
* Add route to the route chain
*
*
* If route contains method setRequest(), it is initialized with a request object
*
* @param string $name Name of the route
* @param Zend_Controller_Router_Route_Interface $route Instance of the route
* @return Zend_Controller_Router_Rewrite
*/
public function addRoute($name, Zend_Controller_Router_Route_Interface $route)
public function addRoute($name, Zend_Controller_Router_Route_Interface $route)
{
if (method_exists($route, 'setRequest')) {
$route->setRequest($this->getFrontController()->getRequest());
}
$this->_routes[$name] = $route;
return $this;
}
@ -123,7 +123,7 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
foreach ($routes as $name => $route) {
$this->addRoute($name, $route);
}
return $this;
}
@ -158,30 +158,30 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
require_once 'Zend/Controller/Router/Exception.php';
throw new Zend_Controller_Router_Exception("No route configuration in section '{$section}'");
}
$config = $config->{$section};
}
foreach ($config as $name => $info) {
$route = $this->_getRouteFromConfig($info);
if ($route instanceof Zend_Controller_Router_Route_Chain) {
if (!isset($info->chain)) {
require_once 'Zend/Controller/Router/Exception.php';
throw new Zend_Controller_Router_Exception("No chain defined");
throw new Zend_Controller_Router_Exception("No chain defined");
}
if ($info->chain instanceof Zend_Config) {
$childRouteNames = $info->chain;
} else {
$childRouteNames = explode(',', $info->chain);
}
}
foreach ($childRouteNames as $childRouteName) {
$childRoute = $this->getRoute(trim($childRouteName));
$route->chain($childRoute);
}
$this->addRoute($name, $route);
} elseif (isset($info->chains) && $info->chains instanceof Zend_Config) {
$this->_addChainRoutesFromConfig($name, $route, $info->chains);
@ -192,7 +192,7 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
return $this;
}
/**
* Get a route frm a config instance
*
@ -206,16 +206,16 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
require_once 'Zend/Loader.php';
Zend_Loader::loadClass($class);
}
$route = call_user_func(array($class, 'getInstance'), $info);
if (isset($info->abstract) && $info->abstract && method_exists($route, 'isAbstract')) {
$route->isAbstract(true);
}
return $route;
}
/**
* Add chain routes from a config route
*
@ -235,16 +235,16 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
} else {
$childRoute = $this->_getRouteFromConfig($childRouteInfo);
}
if ($route instanceof Zend_Controller_Router_Route_Chain) {
$chainRoute = clone $route;
$chainRoute->chain($childRoute);
} else {
$chainRoute = $route->chain($childRoute);
}
$chainName = $name . $this->_chainNameSeparator . $childRouteName;
if (isset($childRouteInfo->chains)) {
$this->_addChainRoutesFromConfig($chainName, $chainRoute, $childRouteInfo->chains);
} else {
@ -266,9 +266,9 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
require_once 'Zend/Controller/Router/Exception.php';
throw new Zend_Controller_Router_Exception("Route $name is not defined");
}
unset($this->_routes[$name]);
return $this;
}
@ -281,7 +281,7 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
public function removeDefaultRoutes()
{
$this->_useDefaultRoutes = false;
return $this;
}
@ -309,7 +309,7 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
require_once 'Zend/Controller/Router/Exception.php';
throw new Zend_Controller_Router_Exception("Route $name is not defined");
}
return $this->_routes[$name];
}
@ -377,14 +377,14 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
if (method_exists($route, 'isAbstract') && $route->isAbstract()) {
continue;
}
// TODO: Should be an interface method. Hack for 1.0 BC
// TODO: Should be an interface method. Hack for 1.0 BC
if (!method_exists($route, 'getVersion') || $route->getVersion() == 1) {
$match = $request->getPathInfo();
} else {
$match = $request;
}
if ($params = $route->match($match)) {
$this->_setRequestParams($request, $params);
$this->_currentRoute = $name;
@ -417,14 +417,14 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
/**
* Generates a URL path that can be used in URL creation, redirection, etc.
*
*
* @param array $userParams Options passed by a user used to override parameters
* @param mixed $name The name of a Route to use
* @param bool $reset Whether to reset to the route defaults ignoring URL params
* @param bool $encode Tells to encode URL parts on output
* @throws Zend_Controller_Router_Exception
* @return string Resulting absolute URL path
*/
*/
public function assemble($userParams, $name = null, $reset = false, $encode = true)
{
if ($name == null) {
@ -434,9 +434,9 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
$name = 'default';
}
}
$params = array_merge($this->_globalParams, $userParams);
$route = $this->getRoute($name);
$url = $route->assemble($params, $reset, $encode);
@ -446,10 +446,10 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
return $url;
}
/**
* Set a global parameter
*
*
* @param string $name
* @param mixed $value
* @return Zend_Controller_Router_Rewrite
@ -457,25 +457,25 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
public function setGlobalParam($name, $value)
{
$this->_globalParams[$name] = $value;
return $this;
}
/**
* Set the separator to use with chain names
*
*
* @param string $separator The separator to use
* @return Zend_Controller_Router_Rewrite
*/
public function setChainNameSeparator($separator) {
$this->_chainNameSeparator = $separator;
return $this;
$this->_chainNameSeparator = $separator;
return $this;
}
/**
* Get the separator to use for chain names
*
*
* @return string
*/
public function getChainNameSeparator() {

View File

@ -16,7 +16,7 @@
* @package Zend_Controller
* @subpackage Router
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @version $Id: Route.php 16541 2009-07-07 06:59:03Z bkarwin $
* @version $Id: Route.php 18951 2009-11-12 16:26:19Z alexander $
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -47,28 +47,28 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
* @var Zend_Translate
*/
protected $_translator;
/**
* Default locale
*
* @var mixed
*/
protected static $_defaultLocale;
/**
* Locale
*
*
* @var mixed
*/
protected $_locale;
/**
* Wether this is a translated route or not
*
* @var boolean
*/
protected $_isTranslated = false;
/**
* Translatable variables
*
@ -132,7 +132,7 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
public function getVersion() {
return 1;
}
/**
* Instantiates route based on passed Zend_Config structure
*
@ -174,20 +174,20 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
$this->_translatable[] = $name;
$this->_isTranslated = true;
}
$this->_parts[$pos] = (isset($reqs[$name]) ? $reqs[$name] : $this->_defaultRegex);
$this->_variables[$pos] = $name;
} else {
if (substr($part, 0, 1) == $this->_urlVariable) {
$part = substr($part, 1);
}
if (substr($part, 0, 1) === '@' && substr($part, 1, 1) !== '@') {
$this->_isTranslated = true;
}
$this->_parts[$pos] = $part;
if ($part !== '*') {
$this->_staticCount++;
}
@ -208,15 +208,15 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
if ($this->_isTranslated) {
$translateMessages = $this->getTranslator()->getMessages();
}
$pathStaticCount = 0;
$values = array();
$matchedPath = '';
if (!$partial) {
$path = trim($path, $this->_urlDelimiter);
}
if ($path !== '') {
$path = explode($this->_urlDelimiter, $path);
@ -229,9 +229,9 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
return false;
}
}
$matchedPath .= $pathPart . $this->_urlDelimiter;
// If it's a wildcard, get the rest of URL as wildcard data and stop matching
if ($this->_parts[$pos] == '*') {
$count = count($path);
@ -253,12 +253,12 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
if (substr($part, 0, 1) === '@') {
$part = substr($part, 1);
}
if (($originalPathPart = array_search($pathPart, $translateMessages)) !== false) {
$pathPart = $originalPathPart;
}
}
if (substr($part, 0, 2) === '@@') {
$part = substr($part, 1);
}
@ -278,7 +278,7 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
$values[$name] = $pathPart;
} else {
$pathStaticCount++;
}
}
}
}
@ -295,11 +295,11 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
return false;
}
}
$this->setMatchedPath(rtrim($matchedPath, $this->_urlDelimiter));
$this->_values = $values;
return $return;
}
@ -315,7 +315,7 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
{
if ($this->_isTranslated) {
$translator = $this->getTranslator();
if (isset($data['@locale'])) {
$locale = $data['@locale'];
unset($data['@locale']);
@ -323,7 +323,7 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
$locale = $this->getLocale();
}
}
$url = array();
$flag = false;
@ -349,12 +349,12 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
require_once 'Zend/Controller/Router/Exception.php';
throw new Zend_Controller_Router_Exception($name . ' is not specified');
}
if ($this->_isTranslated && in_array($name, $this->_translatable)) {
$url[$key] = $translator->translate($value, $locale);
} else {
$url[$key] = $value;
}
}
} elseif ($part != '*') {
if ($this->_isTranslated && substr($part, 0, 1) === '@') {
if (substr($part, 1, 1) !== '@') {
@ -366,7 +366,7 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
if (substr($part, 0, 2) === '@@') {
$part = substr($part, 1);
}
$url[$key] = $part;
}
} else {
@ -385,15 +385,15 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
foreach (array_reverse($url, true) as $key => $value) {
$defaultValue = null;
if (isset($this->_variables[$key])) {
$defaultValue = $this->getDefault($this->_variables[$key]);
if ($this->_isTranslated && $defaultValue !== null && isset($this->_translatable[$this->_variables[$key]])) {
$defaultValue = $translator->translate($defaultValue, $locale);
}
}
if ($flag || $value !== $defaultValue || $partial) {
if ($encode) $value = urlencode($value);
$return = $this->_urlDelimiter . $value . $return;
@ -426,7 +426,7 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
public function getDefaults() {
return $this->_defaults;
}
/**
* Get all variables which are used by the route
*
@ -439,7 +439,7 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
/**
* Set a default translator
*
*
* @param Zend_Translate $translator
* @return void
*/
@ -447,7 +447,7 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
{
self::$_defaultTranslator = $translator;
}
/**
* Get the default translator
*
@ -457,10 +457,10 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
{
return self::$_defaultTranslator;
}
/**
* Set a translator
*
*
* @param Zend_Translate $translator
* @return void
*/
@ -468,10 +468,10 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
{
$this->_translator = $translator;
}
/**
* Get the translator
*
*
* @throws Zend_Controller_Router_Exception When no translator can be found
* @return Zend_Translate
*/
@ -487,19 +487,19 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
} catch (Zend_Exception $e) {
$translator = null;
}
if ($translator instanceof Zend_Translate) {
if ($translator instanceof Zend_Translate) {
return $translator;
}
}
require_once 'Zend/Controller/Router/Exception.php';
throw new Zend_Controller_Router_Exception('Could not find a translator');
}
/**
* Set a default locale
*
*
* @param mixed $locale
* @return void
*/
@ -507,7 +507,7 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
{
self::$_defaultLocale = $locale;
}
/**
* Get the default locale
*
@ -517,10 +517,10 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
{
return self::$_defaultLocale;
}
/**
* Set a locale
*
*
* @param mixed $locale
* @return void
*/
@ -528,10 +528,10 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
{
$this->_locale = $locale;
}
/**
* Get the locale
*
*
* @return mixed
*/
public function getLocale()
@ -546,12 +546,12 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
} catch (Zend_Exception $e) {
$locale = null;
}
if ($locale !== null) {
if ($locale !== null) {
return $locale;
}
}
return null;
}
}

View File

@ -16,7 +16,7 @@
* @package Zend_Controller
* @subpackage Router
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @version $Id: Abstract.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Abstract.php 18951 2009-11-12 16:26:19Z alexander $
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -50,7 +50,7 @@ abstract class Zend_Controller_Router_Route_Abstract implements Zend_Controller_
* @var string
*/
protected $_matchedPath = null;
/**
* Get the version of the route
*
@ -60,7 +60,7 @@ abstract class Zend_Controller_Router_Route_Abstract implements Zend_Controller_
{
return 2;
}
/**
* Set partially matched path
*
@ -71,7 +71,7 @@ abstract class Zend_Controller_Router_Route_Abstract implements Zend_Controller_
{
$this->_matchedPath = $path;
}
/**
* Get partially matched path
*
@ -81,10 +81,10 @@ abstract class Zend_Controller_Router_Route_Abstract implements Zend_Controller_
{
return $this->_matchedPath;
}
/**
* Check or set wether this is an abstract route or not
*
*
* @param boolean $flag
* @return boolean
*/
@ -93,17 +93,17 @@ abstract class Zend_Controller_Router_Route_Abstract implements Zend_Controller_
if ($flag !== null) {
$this->_isAbstract = $flag;
}
return $this->_isAbstract;
}
/**
* Create a new chain
*
*
* @param Zend_Controller_Router_Route_Abstract $route
* @param string $separator
* @return Zend_Controller_Router_Route_Chain
*/
*/
public function chain(Zend_Controller_Router_Route_Abstract $route, $separator = '/')
{
require_once 'Zend/Controller/Router/Route/Chain.php';

View File

@ -16,7 +16,7 @@
* @package Zend_Controller
* @subpackage Router
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @version $Id: Chain.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Chain.php 18951 2009-11-12 16:26:19Z alexander $
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -46,10 +46,10 @@ class Zend_Controller_Router_Route_Chain extends Zend_Controller_Router_Route_Ab
$defs = ($config->defaults instanceof Zend_Config) ? $config->defaults->toArray() : array();
return new self($config->route, $defs);
}
/**
* Add a route to this chain
*
*
* @param Zend_Controller_Router_Route_Abstract $route
* @param string $separator
* @return Zend_Controller_Router_Route_Chain
@ -79,29 +79,29 @@ class Zend_Controller_Router_Route_Chain extends Zend_Controller_Router_Route_Ab
foreach ($this->_routes as $key => $route) {
if ($key > 0 && $matchedPath !== null) {
$separator = substr($subPath, 0, strlen($this->_separators[$key]));
if ($separator !== $this->_separators[$key]) {
return false;
return false;
}
$subPath = substr($subPath, strlen($separator));
}
// TODO: Should be an interface method. Hack for 1.0 BC
// TODO: Should be an interface method. Hack for 1.0 BC
if (!method_exists($route, 'getVersion') || $route->getVersion() == 1) {
$match = $subPath;
} else {
$request->setPathInfo($subPath);
$match = $request;
$match = $request;
}
$res = $route->match($match, true);
if ($res === false) {
return false;
}
$matchedPath = $route->getMatchedPath();
if ($matchedPath !== null) {
$subPath = substr($subPath, strlen($matchedPath));
$separator = substr($subPath, 0, strlen($this->_separators[$key]));
@ -109,9 +109,9 @@ class Zend_Controller_Router_Route_Chain extends Zend_Controller_Router_Route_Ab
$values = $res + $values;
}
$request->setPathInfo($path);
if ($subPath !== '' && $subPath !== false) {
return false;
}
@ -129,17 +129,17 @@ class Zend_Controller_Router_Route_Chain extends Zend_Controller_Router_Route_Ab
{
$value = '';
$numRoutes = count($this->_routes);
foreach ($this->_routes as $key => $route) {
if ($key > 0) {
$value .= $this->_separators[$key];
}
$value .= $route->assemble($data, $reset, $encode, (($numRoutes - 1) > $key));
if (method_exists($route, 'getVariables')) {
$variables = $route->getVariables();
foreach ($variables as $variable) {
$data[$variable] = null;
}
@ -151,7 +151,7 @@ class Zend_Controller_Router_Route_Chain extends Zend_Controller_Router_Route_Ab
/**
* Set the request object for this and the child routes
*
*
* @param Zend_Controller_Request_Abstract|null $request
* @return void
*/

View File

@ -16,7 +16,7 @@
* @package Zend_Controller
* @subpackage Router
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @version $Id: Module.php 16541 2009-07-07 06:59:03Z bkarwin $
* @version $Id: Module.php 18951 2009-11-12 16:26:19Z alexander $
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -80,11 +80,11 @@ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_A
public static function getInstance(Zend_Config $config)
{
$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);
}
@ -151,7 +151,7 @@ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_A
$values = array();
$params = array();
if (!$partial) {
$path = trim($path, self::URI_DELIMITER);
} else {
@ -182,7 +182,7 @@ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_A
}
}
}
if ($partial) {
$this->setMatchedPath($matchedPath);
}
@ -233,9 +233,10 @@ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_A
unset($params[$this->_actionKey]);
foreach ($params as $key => $value) {
$key = ($encode) ? urlencode($key) : $key;
if (is_array($value)) {
foreach ($value as $arrayValue) {
if ($encode) $arrayValue = urlencode($arrayValue);
$arrayValue = ($encode) ? urlencode($arrayValue) : $arrayValue;
$url .= '/' . $key;
$url .= '/' . $arrayValue;
}

View File

@ -16,7 +16,7 @@
* @package Zend_Controller
* @subpackage Router
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @version $Id: Regex.php 16541 2009-07-07 06:59:03Z bkarwin $
* @version $Id: Regex.php 18951 2009-11-12 16:26:19Z alexander $
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -63,7 +63,7 @@ class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Ab
public function getVersion() {
return 1;
}
/**
* Matches a user submitted path with a previously defined route.
* Assigns and returns an array of defaults on a successful match.
@ -79,13 +79,13 @@ class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Ab
} else {
$regex = '#^' . $this->_regex . '#i';
}
$res = preg_match($regex, $path, $values);
if ($res === 0) {
return false;
}
if ($partial) {
$this->setMatchedPath($values[0]);
}
@ -185,7 +185,7 @@ class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Ab
foreach ($mergedData as $key => &$value) {
$value = urlencode($value);
}
}
}
ksort($mergedData);
@ -220,7 +220,7 @@ class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Ab
public function getDefaults() {
return $this->_defaults;
}
/**
* Get all variables which are used by the route
*
@ -229,7 +229,7 @@ class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Ab
public function getVariables()
{
$variables = array();
foreach ($this->_map as $key => $value) {
if (is_numeric($key)) {
$variables[] = $value;
@ -237,7 +237,7 @@ class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Ab
$variables[] = $key;
}
}
return $variables;
}

View File

@ -16,7 +16,7 @@
* @package Zend_Controller
* @subpackage Router
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @version $Id: Static.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Static.php 18951 2009-11-12 16:26:19Z alexander $
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -42,7 +42,7 @@ class Zend_Controller_Router_Route_Static extends Zend_Controller_Router_Route_A
public function getVersion() {
return 1;
}
/**
* Instantiates route based on passed Zend_Config structure
*
@ -85,7 +85,7 @@ class Zend_Controller_Router_Route_Static extends Zend_Controller_Router_Route_A
return $this->_defaults;
}
}
return false;
}