mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Removed unused tests route, this route has been obsolete for some time.
Reducing calls to Router::getInstance(); by almost half, increasing performance on applications larger than a hello world benchmark. Before changes 5551 requests. After changes 2873 requests. git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7524 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
8805173355
commit
32e5f7c886
2 changed files with 2 additions and 9 deletions
|
@ -38,9 +38,4 @@
|
||||||
* ...and connect the rest of 'Pages' controller's urls.
|
* ...and connect the rest of 'Pages' controller's urls.
|
||||||
*/
|
*/
|
||||||
Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
|
Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
|
||||||
/**
|
|
||||||
* Then we connect url '/test' to our test controller. This is helpful in
|
|
||||||
* developement.
|
|
||||||
*/
|
|
||||||
Router::connect('/tests', array('controller' => 'tests', 'action' => 'index'));
|
|
||||||
?>
|
?>
|
|
@ -906,7 +906,6 @@ class Router extends Object {
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
function mapRouteElements($route, $url) {
|
function mapRouteElements($route, $url) {
|
||||||
$_this =& Router::getInstance();
|
|
||||||
if (isset($route[3]['prefix'])) {
|
if (isset($route[3]['prefix'])) {
|
||||||
$prefix = $route[3]['prefix'];
|
$prefix = $route[3]['prefix'];
|
||||||
unset($route[3]['prefix']);
|
unset($route[3]['prefix']);
|
||||||
|
@ -937,7 +936,7 @@ class Router extends Object {
|
||||||
unset($params[$key]);
|
unset($params[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
list($named, $params) = $_this->getNamedElements($params);
|
list($named, $params) = Router::getNamedElements($params);
|
||||||
|
|
||||||
if (!strpos($route[0], '*') && (!empty($pass) || !empty($named))) {
|
if (!strpos($route[0], '*') && (!empty($pass) || !empty($named))) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -1011,8 +1010,6 @@ class Router extends Object {
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __mapRoute($route, $params = array()) {
|
function __mapRoute($route, $params = array()) {
|
||||||
$_this =& Router::getInstance();
|
|
||||||
|
|
||||||
if(isset($params['plugin']) && isset($params['controller']) && $params['plugin'] === $params['controller']) {
|
if(isset($params['plugin']) && isset($params['controller']) && $params['plugin'] === $params['controller']) {
|
||||||
unset($params['controller']);
|
unset($params['controller']);
|
||||||
}
|
}
|
||||||
|
@ -1033,6 +1030,7 @@ class Router extends Object {
|
||||||
$count = count($params['named']);
|
$count = count($params['named']);
|
||||||
$keys = array_keys($params['named']);
|
$keys = array_keys($params['named']);
|
||||||
$named = array();
|
$named = array();
|
||||||
|
$_this =& Router::getInstance();
|
||||||
|
|
||||||
for ($i = 0; $i < $count; $i++) {
|
for ($i = 0; $i < $count; $i++) {
|
||||||
$named[] = $keys[$i] . $_this->named['separator'] . $params['named'][$keys[$i]];
|
$named[] = $keys[$i] . $_this->named['separator'] . $params['named'][$keys[$i]];
|
||||||
|
|
Loading…
Reference in a new issue