From a8094abac7ea0b64d5e523192892b2d3b063fba9 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Thu, 17 Jan 2013 21:42:33 +0100 Subject: load classpaths of apps before routes --- lib/base.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib/base.php') diff --git a/lib/base.php b/lib/base.php index 6896c91822e..1d525f7e19d 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; -- cgit v1.2.3