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.
This commit is contained in:
Lukas Reschke 2015-09-15 11:55:23 +02:00
parent 1d315512ea
commit 4680691ca6
1 changed files with 6 additions and 1 deletions

View File

@ -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)) {