diff --git a/lib/private/Route/Router.php b/lib/private/Route/Router.php index 2a60287254b..376852a1b6e 100644 --- a/lib/private/Route/Router.php +++ b/lib/private/Route/Router.php @@ -169,7 +169,7 @@ class Router implements IRouter { $this->loadedApps['core'] = true; $this->useCollection('root'); $this->setupRoutes($this->getAttributeRoutes('core'), 'core'); - require __DIR__ . '/../../../core/routes.php'; + $this->requireRouteFile(__DIR__ . '/../../../core/routes.php', 'core'); // Also add the OCS collection $collection = $this->getCollection('root.ocs'); diff --git a/lib/public/AppFramework/App.php b/lib/public/AppFramework/App.php index 06404baea70..c7adbd56b7b 100644 --- a/lib/public/AppFramework/App.php +++ b/lib/public/AppFramework/App.php @@ -9,10 +9,7 @@ declare(strict_types=1); */ namespace OCP\AppFramework; -use OC\AppFramework\Routing\RouteConfig; -use OC\Route\Router; use OC\ServerContainer; -use OCP\Route\IRouter; use Psr\Log\LoggerInterface; /** @@ -96,35 +93,6 @@ class App { return $this->container; } - /** - * This function is to be called to create single routes and restful routes based on the given $routes array. - * - * Example code in routes.php of tasks app (it will register two restful resources): - * $routes = array( - * 'resources' => array( - * 'lists' => array('url' => '/tasklists'), - * 'tasks' => array('url' => '/tasklists/{listId}/tasks') - * ) - * ); - * - * $a = new TasksApp(); - * $a->registerRoutes($this, $routes); - * - * @param \OCP\Route\IRouter $router - * @param array $routes - * @since 6.0.0 - * @suppress PhanAccessMethodInternal - * @deprecated 20.0.0 Just return an array from your routes.php - */ - public function registerRoutes(IRouter $router, array $routes) { - if (!($router instanceof Router)) { - throw new \RuntimeException('Can only setup routes with real router'); - } - - $routeConfig = new RouteConfig($this->container, $router, $routes); - $routeConfig->register(); - } - /** * This function is called by the routing component to fire up the frameworks dispatch mechanism. *