summaryrefslogtreecommitdiffstats
path: root/lib/private/server.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/server.php')
-rw-r--r--lib/private/server.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/private/server.php b/lib/private/server.php
index 7696fc207fd..8c9ea39c562 100644
--- a/lib/private/server.php
+++ b/lib/private/server.php
@@ -158,6 +158,10 @@ class Server extends SimpleContainer implements IServerContainer {
$config = $c->getConfig();
return new \OC\BackgroundJob\JobList($c->getDatabaseConnection(), $config);
});
+ $this->registerService('Router', function ($c){
+ $router = new \OC\Route\Router();
+ return $router;
+ });
}
/**
@@ -364,4 +368,15 @@ class Server extends SimpleContainer implements IServerContainer {
function getJobList(){
return $this->query('JobList');
}
+
+ /**
+ * Returns a router for generating and matching urls
+ *
+ * @return \OCP\Route\IRouter
+ */
+ function getRouter(){
+ $router = $this->query('Router');
+ $router->loadRoutes();
+ return $router;
+ }
}