summaryrefslogtreecommitdiffstats
path: root/lib/api.php
diff options
context:
space:
mode:
authorTom Needham <tom@owncloud.com>2012-07-30 10:56:21 +0000
committerTom Needham <tom@owncloud.com>2012-07-30 10:56:21 +0000
commite33174f115d7459afb15131f0bc4a6386a673608 (patch)
tree8e32384568cde017bd3538f7415b57815d1386fd /lib/api.php
parentcbc0f0c1c5c5ad9ecc1b20c0f0aee7b4ea564579 (diff)
downloadnextcloud-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.php8
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();