refactoring container for speed.

This commit is contained in:
Taylor Otwell
2011-10-05 18:32:48 -05:00
parent 4263203dda
commit 71b0ab8b8d
32 changed files with 1221 additions and 1486 deletions

View File

@@ -87,12 +87,11 @@ class Router {
/**
* Search the routes for the route matching a request method and URI.
*
* @param Request $request
* @param string $method
* @param string $uri
* @return Route
*/
public function route(Request $request, $method, $uri)
public function route($method, $uri)
{
$routes = $this->loader->load($uri);
@@ -104,7 +103,7 @@ class Router {
// no need to spin through all of the routes.
if (isset($routes[$destination]))
{
return $request->route = new Route($destination, $routes[$destination], array());
return Request::$route = new Route($destination, $routes[$destination], array());
}
foreach ($routes as $keys => $callback)
@@ -120,13 +119,13 @@ class Router {
if (preg_match('#^'.$this->translate_wildcards($key).'$#', $destination))
{
return $request->route = new Route($keys, $callback, $this->parameters($destination, $key));
return Request::$route = new Route($keys, $callback, $this->parameters($destination, $key));
}
}
}
}
return $request->route = $this->route_to_controller($method, $uri, $destination);
return Request::$route = $this->route_to_controller($method, $uri, $destination);
}
/**