Merge pull request #19039 from owncloud/setup-autoloader-earlier
Define allowed app roots earlier
This commit is contained in:
commit
b6fe5b6f3c
|
@ -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)) {
|
||||
|
|
Loading…
Reference in New Issue