diff options
author | Tom Needham <tom@owncloud.com> | 2012-07-30 10:56:21 +0000 |
---|---|---|
committer | Tom Needham <tom@owncloud.com> | 2012-07-30 10:56:21 +0000 |
commit | e33174f115d7459afb15131f0bc4a6386a673608 (patch) | |
tree | 8e32384568cde017bd3538f7415b57815d1386fd /lib/api.php | |
parent | cbc0f0c1c5c5ad9ecc1b20c0f0aee7b4ea564579 (diff) | |
download | nextcloud-server-e33174f115d7459afb15131f0bc4a6386a673608.tar.gz nextcloud-server-e33174f115d7459afb15131f0bc4a6386a673608.zip |
Add core routes and include them in OC_API::call()
Diffstat (limited to 'lib/api.php')
-rw-r--r-- | lib/api.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/api.php b/lib/api.php index cf40167b07a..b1176a07077 100644 --- a/lib/api.php +++ b/lib/api.php @@ -29,7 +29,7 @@ class OC_API { /** * api actions */ - protected $actions = array(); + protected static $actions = array(); /** * registers an api call @@ -37,7 +37,7 @@ class OC_API { * @param string $url the url to match * @param callable $action the function to run */ - public function register($method, $url, $action){ + public static function register($method, $url, $action){ $name = strtolower($method).$url; if(!isset(self::$actions[$name])){ OC_Router::create($name, $url) @@ -51,7 +51,7 @@ class OC_API { * handles an api call * @param array $parameters */ - public function call($parameters){ + public static function call($parameters){ // Get the routes // TODO cache @@ -61,6 +61,8 @@ class OC_API { require_once($file); } } + // include core routes + require_once(OC::$SERVERROOT.'core/routes.php'); $name = $parameters['_name']; $response = array(); |