Move loading of routes to OC::getRouter function
This commit is contained in:
parent
3722928c46
commit
72b2324b68
|
@ -278,6 +278,7 @@ class OC{
|
||||||
public static function getRouter() {
|
public static function getRouter() {
|
||||||
if (!isset(OC::$router)) {
|
if (!isset(OC::$router)) {
|
||||||
OC::$router = new OC_Router();
|
OC::$router = new OC_Router();
|
||||||
|
OC::$router->loadRoutes();
|
||||||
}
|
}
|
||||||
|
|
||||||
return OC::$router;
|
return OC::$router;
|
||||||
|
|
|
@ -16,10 +16,15 @@ class OC_Router {
|
||||||
protected $collections = array();
|
protected $collections = array();
|
||||||
protected $collection = null;
|
protected $collection = null;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
// TODO cache
|
||||||
|
$this->loadRoutes();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* loads the api routes
|
* loads the api routes
|
||||||
*/
|
*/
|
||||||
public function loadRoutes(){
|
public function loadRoutes() {
|
||||||
// TODO cache
|
// TODO cache
|
||||||
foreach(OC_APP::getEnabledApps() as $app){
|
foreach(OC_APP::getEnabledApps() as $app){
|
||||||
$file = OC_App::getAppPath($app).'/appinfo/routes.php';
|
$file = OC_App::getAppPath($app).'/appinfo/routes.php';
|
||||||
|
|
Loading…
Reference in New Issue