Skip to content
Snippets Groups Projects
Commit 6ba26234 authored by Bart Visscher's avatar Bart Visscher
Browse files

Move loading of routes to OC::getRouter function

parent 37ef522b
Branches
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -16,6 +16,11 @@ class OC_Router {
protected $collections = array();
protected $collection = null;
public function __construct() {
// TODO cache
$this->loadRoutes();
}
/**
* loads the api routes
*/
......
......@@ -26,7 +26,6 @@ use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
OC::getRouter()->useCollection('ocs');
OC::getRouter()->loadRoutes();
try {
OC::getRouter()->match($_SERVER['PATH_INFO']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment