Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-03-10 17:04:58 +0400
committerRobin Appelman <icewind@owncloud.com>2014-03-10 17:04:58 +0400
commit8ab7d18a6a2b023527d2eef63099e2834c46ec97 (patch)
tree393f7f704655555a1892200215a46f4b741abc80 /lib/private/server.php
parent0ffd32a1ae8c4b9da2434a0b5623c1fe6e910467 (diff)
Move the router classes to a namespace and expose it with a public interface
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;
+ }
}