diff --git a/lib/private/app.php b/lib/private/app.php index f6a81f9945..e42fba525e 100644 --- a/lib/private/app.php +++ b/lib/private/app.php @@ -101,6 +101,15 @@ class OC_App { } // Load the enabled apps here $apps = self::getEnabledApps(); + + // Add each apps' folder as allowed class path + foreach($apps as $app) { + $path = self::getAppPath($app); + if($path !== false) { + \OC::$loader->addValidRoot($path); + } + } + // prevent app.php from printing output ob_start(); foreach ($apps as $app) { @@ -122,7 +131,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)) {