diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-03-10 14:04:58 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-03-10 14:04:58 +0100 |
commit | 8ab7d18a6a2b023527d2eef63099e2834c46ec97 (patch) | |
tree | 393f7f704655555a1892200215a46f4b741abc80 /lib/private/server.php | |
parent | 0ffd32a1ae8c4b9da2434a0b5623c1fe6e910467 (diff) | |
download | nextcloud-server-8ab7d18a6a2b023527d2eef63099e2834c46ec97.tar.gz nextcloud-server-8ab7d18a6a2b023527d2eef63099e2834c46ec97.zip |
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.php | 15 |
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; + } } |