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.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/private/Route/Router.php b/lib/private/Route/Router.php
index 02f371e808a..90225212e9a 100644
--- a/lib/private/Route/Router.php
+++ b/lib/private/Route/Router.php
@@ -53,7 +53,7 @@ class Router implements IRouter {
public function __construct(
protected LoggerInterface $logger,
IRequest $request,
- private IConfig $config,
+ protected IConfig $config,
protected IEventLogger $eventLogger,
private ContainerInterface $container,
protected IAppManager $appManager,
@@ -74,6 +74,14 @@ class Router implements IRouter {
$this->root = $this->getCollection('root');
}
+ public function setContext(RequestContext $context): void {
+ $this->context = $context;
+ }
+
+ public function getRouteCollection() {
+ return $this->root;
+ }
+
/**
* Get the files to load the routes from
*
@@ -102,7 +110,7 @@ class Router implements IRouter {
*
* @param null|string $app
*/
- public function loadRoutes($app = null) {
+ public function loadRoutes(?string $app = null, bool $skipLoadingCore = false): void {
if (is_string($app)) {
$app = $this->appManager->cleanAppId($app);
}
@@ -165,7 +173,7 @@ class Router implements IRouter {
}
$this->eventLogger->end('route:load:files');
- if (!isset($this->loadedApps['core'])) {
+ if (!$skipLoadingCore && !isset($this->loadedApps['core'])) {
$this->loadedApps['core'] = true;
$this->useCollection('root');
$this->setupRoutes($this->getAttributeRoutes('core'), 'core');