summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-08-02 17:59:18 +0200
committerBart Visscher <bartv@thisnet.nl>2012-08-02 21:44:58 +0200
commit6ba2623485655460440a972e34a8a2a2fda02821 (patch)
tree7ab029eb5230abb294f7c07ffee2ebb2bf67a807 /lib
parent37ef522b057caf0a0058f6be87db39f7a4f1e174 (diff)
downloadnextcloud-server-6ba2623485655460440a972e34a8a2a2fda02821.tar.gz
nextcloud-server-6ba2623485655460440a972e34a8a2a2fda02821.zip
Move loading of routes to OC::getRouter function
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php1
-rw-r--r--lib/router.php7
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/base.php b/lib/base.php
index 43588944d04..0d9ececc0c9 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -278,6 +278,7 @@ class OC{
public static function getRouter() {
if (!isset(OC::$router)) {
OC::$router = new OC_Router();
+ OC::$router->loadRoutes();
}
return OC::$router;
diff --git a/lib/router.php b/lib/router.php
index c3864cfc91c..5c5171cf82d 100644
--- a/lib/router.php
+++ b/lib/router.php
@@ -16,10 +16,15 @@ class OC_Router {
protected $collections = array();
protected $collection = null;
+ public function __construct() {
+ // TODO cache
+ $this->loadRoutes();
+ }
+
/**
* loads the api routes
*/
- public function loadRoutes(){
+ public function loadRoutes() {
// TODO cache
foreach(OC_APP::getEnabledApps() as $app){
$file = OC_App::getAppPath($app).'/appinfo/routes.php';