diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-07-30 20:48:03 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-07-30 21:19:02 +0200 |
commit | 0271bfa3b7849de64bfbb9dd96313fc35da14e29 (patch) | |
tree | 8cd397bd6303396a19915577adeb27af56900cf1 /lib/router.php | |
parent | 372fdf8077634d1b82db326db61a204ef6512892 (diff) | |
download | nextcloud-server-0271bfa3b7849de64bfbb9dd96313fc35da14e29.tar.gz nextcloud-server-0271bfa3b7849de64bfbb9dd96313fc35da14e29.zip |
Move loading of routes to OC_Router
Diffstat (limited to 'lib/router.php')
-rw-r--r-- | lib/router.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/router.php b/lib/router.php index f037ecdfef4..f76f64ac82b 100644 --- a/lib/router.php +++ b/lib/router.php @@ -16,6 +16,21 @@ class OC_Router { protected $collections = array(); protected $collection = null; + /** + * loads the api routes + */ + public function loadRoutes(){ + // TODO cache + foreach(OC_APP::getEnabledApps() as $app){ + $file = OC_App::getAppPath($app).'/appinfo/routes.php'; + if(file_exists($file)){ + require_once($file); + } + } + // include ocs routes + require_once(OC::$SERVERROOT.'/ocs/routes.php'); + } + public function useCollection($name) { if (!isset($this->collections[$name])) { $this->collections[$name] = new RouteCollection(); |