From edc1c77dd917e232840084dd3917df62c06eb25b Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 1 Jul 2020 09:45:46 +0200 Subject: 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 --- lib/private/AppFramework/Routing/RouteConfig.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'lib/private/AppFramework/Routing') 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]); } } } -- cgit v1.2.3