diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-01-07 00:16:10 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-01-07 00:16:10 +0100 |
commit | e8d08d4930fae31a665c679b5ac1a147859eb099 (patch) | |
tree | 426671882f753d0fea8f80c786bdd6892d57cdb5 /lib/router.php | |
parent | 1137723b2a46c37d61e7f501694c73562b21ef74 (diff) | |
parent | 0b007235b99fa8d66cdb8ca917fe2f45dd8e4edc (diff) | |
download | nextcloud-server-e8d08d4930fae31a665c679b5ac1a147859eb099.tar.gz nextcloud-server-e8d08d4930fae31a665c679b5ac1a147859eb099.zip |
merge master into filesystem
Diffstat (limited to 'lib/router.php')
-rw-r--r-- | lib/router.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/router.php b/lib/router.php index 8cb8fd4f33b..27e14c38abf 100644 --- a/lib/router.php +++ b/lib/router.php @@ -58,6 +58,23 @@ class OC_Router { * loads the api routes */ public function loadRoutes() { + + // TODO cache + $this->root = $this->getCollection('root'); + foreach(OC_APP::getEnabledApps() as $app){ + $file = OC_App::getAppPath($app).'/appinfo/routes.php'; + if(file_exists($file)){ + $this->useCollection($app); + require_once($file); + $collection = $this->getCollection($app); + $this->root->addCollection($collection, '/apps/'.$app); + } + } + // include ocs routes + require_once(OC::$SERVERROOT.'/ocs/routes.php'); + $collection = $this->getCollection('ocs'); + $this->root->addCollection($collection, '/ocs'); + foreach($this->getRoutingFiles() as $app => $file) { $this->useCollection($app); require_once $file; @@ -67,6 +84,7 @@ class OC_Router { $this->useCollection('root'); require_once 'settings/routes.php'; require_once 'core/routes.php'; + } protected function getCollection($name) { |