From a8094abac7ea0b64d5e523192892b2d3b063fba9 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Thu, 17 Jan 2013 21:42:33 +0100 Subject: [PATCH 1/2] load classpaths of apps before routes --- lib/base.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/base.php b/lib/base.php index 6896c91822..1d525f7e19 100644 --- a/lib/base.php +++ b/lib/base.php @@ -321,6 +321,18 @@ class OC return OC::$router; } + + public static function loadAppClassPaths() + { + foreach(OC_APP::getEnabledApps() as $app) { + $file = OC_App::getAppPath($app).'/appinfo/classpath.php'; + if(file_exists($file)) { + require_once $file; + } + } + } + + public static function init() { // register autoloader @@ -537,6 +549,11 @@ class OC header('location: ' . OC_Helper::linkToRemote('webdav')); return; } + + // load all the classpaths from the enabled apps so they are available + // in the routing files of each app + OC::loadAppClassPaths(); + try { OC::getRouter()->match(OC_Request::getPathInfo()); return; From 2b95ae1e6d2296ef81259e6762fb3e6662f3bc6c Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Thu, 17 Jan 2013 21:44:40 +0100 Subject: [PATCH 2/2] spaces to tabs --- lib/base.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/base.php b/lib/base.php index 1d525f7e19..15308138a1 100644 --- a/lib/base.php +++ b/lib/base.php @@ -322,15 +322,15 @@ class OC } - public static function loadAppClassPaths() - { - foreach(OC_APP::getEnabledApps() as $app) { - $file = OC_App::getAppPath($app).'/appinfo/classpath.php'; - if(file_exists($file)) { - require_once $file; - } - } - } + public static function loadAppClassPaths() + { + foreach(OC_APP::getEnabledApps() as $app) { + $file = OC_App::getAppPath($app).'/appinfo/classpath.php'; + if(file_exists($file)) { + require_once $file; + } + } + } public static function init() @@ -550,9 +550,9 @@ class OC return; } - // load all the classpaths from the enabled apps so they are available - // in the routing files of each app - OC::loadAppClassPaths(); + // load all the classpaths from the enabled apps so they are available + // in the routing files of each app + OC::loadAppClassPaths(); try { OC::getRouter()->match(OC_Request::getPathInfo());