aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Route/Router.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Route/Router.php')
-rw-r--r--lib/private/Route/Router.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/private/Route/Router.php b/lib/private/Route/Router.php
index d073132516d..376852a1b6e 100644
--- a/lib/private/Route/Router.php
+++ b/lib/private/Route/Router.php
@@ -54,9 +54,9 @@ class Router implements IRouter {
protected LoggerInterface $logger,
IRequest $request,
private IConfig $config,
- private IEventLogger $eventLogger,
+ protected IEventLogger $eventLogger,
private ContainerInterface $container,
- private IAppManager $appManager,
+ protected IAppManager $appManager,
) {
$baseUrl = \OC::$WEBROOT;
if (!($config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true')) {
@@ -116,9 +116,11 @@ class Router implements IRouter {
$this->loaded = true;
$routingFiles = $this->getRoutingFiles();
+ $this->eventLogger->start('route:load:attributes', 'Loading Routes from attributes');
foreach (\OC_App::getEnabledApps() as $enabledApp) {
$this->loadAttributeRoutes($enabledApp);
}
+ $this->eventLogger->end('route:load:attributes');
} else {
if (isset($this->loadedApps[$app])) {
return;
@@ -140,6 +142,7 @@ class Router implements IRouter {
}
}
+ $this->eventLogger->start('route:load:files', 'Loading Routes from files');
foreach ($routingFiles as $app => $file) {
if (!isset($this->loadedApps[$app])) {
if (!$this->appManager->isAppLoaded($app)) {
@@ -160,12 +163,13 @@ class Router implements IRouter {
$this->root->addCollection($collection);
}
}
+ $this->eventLogger->end('route:load:files');
if (!isset($this->loadedApps['core'])) {
$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');
@@ -265,6 +269,7 @@ class Router implements IRouter {
$this->loadRoutes();
}
+ $this->eventLogger->start('route:url:match', 'Symfony url matcher call');
$matcher = new UrlMatcher($this->root, $this->context);
try {
$parameters = $matcher->match($url);
@@ -283,6 +288,7 @@ class Router implements IRouter {
throw $e;
}
}
+ $this->eventLogger->end('route:url:match');
$this->eventLogger->end('route:match');
return $parameters;