diff options
author | Tom Needham <tom@owncloud.com> | 2012-07-30 12:57:35 +0000 |
---|---|---|
committer | Tom Needham <tom@owncloud.com> | 2012-07-30 12:57:35 +0000 |
commit | b0dc4383e14713a79c67f71e8e3f3c1c09d8958c (patch) | |
tree | 797c4978042bf03cf4583f0837834585d832bc3d | |
parent | b563dff10a60e08ad270dc78404102f082abf184 (diff) | |
download | nextcloud-server-b0dc4383e14713a79c67f71e8e3f3c1c09d8958c.tar.gz nextcloud-server-b0dc4383e14713a79c67f71e8e3f3c1c09d8958c.zip |
Clean code slightly
-rw-r--r-- | lib/api.php | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/lib/api.php b/lib/api.php index 46f58debdcf..17663b53b84 100644 --- a/lib/api.php +++ b/lib/api.php @@ -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(); @@ -92,6 +84,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 * @param string $format the format xml|json |