diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2020-07-01 09:45:46 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2020-07-07 12:33:22 +0200 |
commit | edc1c77dd917e232840084dd3917df62c06eb25b (patch) | |
tree | 61e75d849e068403d43bf3af61c8b54816b695c6 /lib/private/AppFramework | |
parent | cd7a6276f27e641cfa8f835c53cd3781e69d1d67 (diff) | |
download | nextcloud-server-edc1c77dd917e232840084dd3917df62c06eb25b.tar.gz nextcloud-server-edc1c77dd917e232840084dd3917df62c06eb25b.zip |
Do not create a RouteActionHandler object for each route
This is not required and doesn't allow us to be properly lazy. On top of
it this doesnt allow us to cache the routes (since closures/objects
can't be cached).
This is the first small step into cleaning up the routing we have
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r-- | lib/private/AppFramework/Routing/RouteConfig.php | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/private/AppFramework/Routing/RouteConfig.php b/lib/private/AppFramework/Routing/RouteConfig.php index c10aafd55f7..9a74564b613 100644 --- a/lib/private/AppFramework/Routing/RouteConfig.php +++ b/lib/private/AppFramework/Routing/RouteConfig.php @@ -140,12 +140,9 @@ class RouteConfig { $routeName = $routeNamePrefix . $this->appName . '.' . $controller . '.' . $action . $postfix; - // register the route - $handler = new RouteActionHandler($this->container, $controllerName, $actionName); - $router = $this->router->create($routeName, $url) ->method($verb) - ->action($handler); + ->setDefault('caller', [$this->appName, $controllerName, $actionName]); // optionally register requirements for route. This is used to // tell the route parser how url parameters should be matched @@ -233,9 +230,9 @@ class RouteConfig { $routeName = $routeNamePrefix . $this->appName . '.' . strtolower($resource) . '.' . strtolower($method); - $this->router->create($routeName, $url)->method($verb)->action( - new RouteActionHandler($this->container, $controllerName, $actionName) - ); + $this->router->create($routeName, $url) + ->method($verb) + ->setDefault('caller', [$this->appName, $controllerName, $actionName]); } } } |