diff --git a/lib/base.php b/lib/base.php index 43588944d04dde703fd7ac7a90bdcc8c6ab037b0..0d9ececc0c9826d2c45e69906e39d51479fbca7e 100644 --- a/lib/base.php +++ b/lib/base.php @@ -278,6 +278,7 @@ class OC{ public static function getRouter() { if (!isset(OC::$router)) { OC::$router = new OC_Router(); + OC::$router->loadRoutes(); } return OC::$router; diff --git a/lib/router.php b/lib/router.php index 5dd51e7915692f48693faeea0848669d5731a8e5..a721255f2977095f890ef0183242ba46958a3021 100644 --- a/lib/router.php +++ b/lib/router.php @@ -16,10 +16,15 @@ class OC_Router { protected $collections = array(); protected $collection = null; + public function __construct() { + // TODO cache + $this->loadRoutes(); + } + /** * loads the api routes */ - public function loadRoutes(){ + public function loadRoutes() { // TODO cache foreach(OC_APP::getEnabledApps() as $app){ $file = OC_App::getAppPath($app).'/appinfo/routes.php';