Add loading of routes in OC_Router

This commit is contained in:
Bart Visscher 2012-07-30 20:48:03 +02:00
parent b3848581bf
commit 9e80f0954d
1 changed files with 13 additions and 0 deletions

View File

@ -16,6 +16,19 @@ class OC_Router {
protected $collections = array(); protected $collections = array();
protected $collection = null; 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);
}
}
}
public function useCollection($name) { public function useCollection($name) {
if (!isset($this->collections[$name])) { if (!isset($this->collections[$name])) {
$this->collections[$name] = new RouteCollection(); $this->collections[$name] = new RouteCollection();