Skip to content
Snippets Groups Projects
Commit b0dc4383 authored by Tom Needham's avatar Tom Needham
Browse files

Clean code slightly

parent b563dff1
No related branches found
No related tags found
No related merge requests found
...@@ -55,15 +55,7 @@ class OC_API { ...@@ -55,15 +55,7 @@ class OC_API {
public static function call($parameters){ public static function call($parameters){
// Get the routes // Get the routes
// TODO cache self::loadRoutes();
foreach(OC_APP::getEnabledApps() as $app){
$file = OC_App::getAppPath($app).'/appinfo/routes.php';
if(file_exists($file)){
require_once($file);
}
}
// include core routes
require_once(OC::$SERVERROOT.'ocs/routes.php');
$name = $parameters['_name']; $name = $parameters['_name'];
$response = array(); $response = array();
...@@ -91,6 +83,21 @@ class OC_API { ...@@ -91,6 +83,21 @@ class OC_API {
} }
} }
/**
* loads the api routes
*/
private static function loadRoutes(){
// TODO cache
foreach(OC_APP::getEnabledApps() as $app){
$file = OC_App::getAppPath($app).'/appinfo/routes.php';
if(file_exists($file)){
require_once($file);
}
}
// include core routes
require_once(OC::$SERVERROOT.'ocs/routes.php');
}
/** /**
* respond to a call * respond to a call
* @param int|array $response the response * @param int|array $response the response
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment