From 32e5f7c886309e8e40547067a49484b812a94c5a Mon Sep 17 00:00:00 2001 From: phpnut Date: Wed, 27 Aug 2008 12:36:57 +0000 Subject: [PATCH] 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 --- app/config/routes.php | 5 ----- cake/libs/router.php | 6 ++---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/app/config/routes.php b/app/config/routes.php index 8f2881f7f..3dda7484a 100644 --- a/app/config/routes.php +++ b/app/config/routes.php @@ -38,9 +38,4 @@ * ...and connect the rest of 'Pages' controller's urls. */ 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')); ?> \ No newline at end of file diff --git a/cake/libs/router.php b/cake/libs/router.php index 83a2e6b76..f244c1091 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -906,7 +906,6 @@ class Router extends Object { * @static */ function mapRouteElements($route, $url) { - $_this =& Router::getInstance(); if (isset($route[3]['prefix'])) { $prefix = $route[3]['prefix']; unset($route[3]['prefix']); @@ -937,7 +936,7 @@ class Router extends Object { unset($params[$key]); } } - list($named, $params) = $_this->getNamedElements($params); + list($named, $params) = Router::getNamedElements($params); if (!strpos($route[0], '*') && (!empty($pass) || !empty($named))) { return false; @@ -1011,8 +1010,6 @@ class Router extends Object { * @access private */ function __mapRoute($route, $params = array()) { - $_this =& Router::getInstance(); - if(isset($params['plugin']) && isset($params['controller']) && $params['plugin'] === $params['controller']) { unset($params['controller']); } @@ -1033,6 +1030,7 @@ class Router extends Object { $count = count($params['named']); $keys = array_keys($params['named']); $named = array(); + $_this =& Router::getInstance(); for ($i = 0; $i < $count; $i++) { $named[] = $keys[$i] . $_this->named['separator'] . $params['named'][$keys[$i]];