summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-09-15 11:55:23 +0200
committerLukas Reschke <lukas@owncloud.com>2015-09-15 12:10:23 +0200
commit4680691ca6912cb5448cc1a09250464b28396474 (patch)
tree8705a5e0cfd5819f78549c11ca793d3190277adf
parent1d315512eaec830008f9d9a500342fadef9595c1 (diff)
downloadnextcloud-server-4680691ca6912cb5448cc1a09250464b28396474.tar.gz
nextcloud-server-4680691ca6912cb5448cc1a09250464b28396474.zip
Define allowed app roots earlier
The autoloader needs to be run before including the app.php, otherwise it depends on what app gets executed first and apps that rely on the dependency of other apps in app.php may break.
-rw-r--r--lib/private/app.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/app.php b/lib/private/app.php
index f6a81f9945f..58ae770fe25 100644
--- a/lib/private/app.php
+++ b/lib/private/app.php
@@ -101,6 +101,12 @@ class OC_App {
}
// Load the enabled apps here
$apps = self::getEnabledApps();
+
+ // Add each apps' folder as allowed class path
+ foreach($apps as $app) {
+ \OC::$loader->addValidRoot(self::getAppPath($app));
+ }
+
// prevent app.php from printing output
ob_start();
foreach ($apps as $app) {
@@ -122,7 +128,6 @@ class OC_App {
*/
public static function loadApp($app, $checkUpgrade = true) {
self::$loadedApps[] = $app;
- \OC::$loader->addValidRoot(self::getAppPath($app));
if (is_file(self::getAppPath($app) . '/appinfo/app.php')) {
\OC::$server->getEventLogger()->start('load_app_' . $app, 'Load app: ' . $app);
if ($checkUpgrade and self::shouldUpgrade($app)) {