Adding a check for loaded routes. This prevents routes being loaded on each dispatched action, such as when requestAction is called.

This commit is contained in:
mark_story 2010-11-14 01:12:39 -05:00
parent f27566336c
commit afd2683602

View file

@ -176,9 +176,11 @@ class Dispatcher {
* @return array Parameters found in POST and GET.
*/
public function parseParams(CakeRequest $request, $additionalParams = array()) {
$namedExpressions = Router::getNamedExpressions();
extract($namedExpressions);
include CONFIGS . 'routes.php';
if (count(Router::$routes) > 0) {
$namedExpressions = Router::getNamedExpressions();
extract($namedExpressions);
include CONFIGS . 'routes.php';
}
$params = Router::parse($request->url);
$request->addParams($params);