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

Clean code slightly

parent b563dff1
Branches
No related tags found
No related merge requests found
......@@ -55,15 +55,7 @@ class OC_API {
public static function call($parameters){
// Get the routes
// 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');
self::loadRoutes();
$name = $parameters['_name'];
$response = array();
......@@ -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
* @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