summaryrefslogtreecommitdiffstats
path: root/lib/private/server.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-03-17 21:07:05 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2014-03-17 21:07:05 +0100
commit756bbe87866471a25e1d437b60eb895d515fc103 (patch)
tree7eb0b65f0aa481878451e515c6fb62a5c43bd0a9 /lib/private/server.php
parent6fbf3dd7c4e64a68d2b8a0a2c24a1b92de7868b1 (diff)
parent4a2b16d76dafbd83c3f8c137cba9edda375b206a (diff)
downloadnextcloud-server-756bbe87866471a25e1d437b60eb895d515fc103.tar.gz
nextcloud-server-756bbe87866471a25e1d437b60eb895d515fc103.zip
Merge pull request #7649 from owncloud/routing-public
Move routing classes to an interface and expose it in the public api
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;
+ }
}