* 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;