Move loading of routes to OC::getRouter function

remotes/origin/stable5
Bart Visscher 13 years ago
parent 3722928c46
commit 72b2324b68
  1. 1
      lib/base.php
  2. 7
      lib/router.php

@ -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…
Cancel
Save