From 7a3d83d63038e5db0af790b827b73ec7335a6961 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 9 Jun 2017 14:49:40 +0200 Subject: [PATCH] Register autoloading before running migrations Signed-off-by: Joas Schilling --- lib/private/Installer.php | 3 ++- lib/private/legacy/app.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/private/Installer.php b/lib/private/Installer.php index 87cb262c96..60b0336fb5 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -533,6 +533,8 @@ class Installer { public static function installShippedApp($app) { //install the database $appPath = OC_App::getAppPath($app); + \OC_App::registerAutoloading($app, $appPath); + if(is_file("$appPath/appinfo/database.xml")) { try { OC_DB::createDbFromStructure("$appPath/appinfo/database.xml"); @@ -549,7 +551,6 @@ class Installer { } //run appinfo/install.php - \OC_App::registerAutoloading($app, $appPath); self::includeAppScript("$appPath/appinfo/install.php"); $info = OC_App::getAppInfo($app); diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index 3ca05d85c2..463e13da91 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -1042,6 +1042,8 @@ class OC_App { if($appPath === false) { return false; } + self::registerAutoloading($appId, $appPath); + $appData = self::getAppInfo($appId); self::executeRepairSteps($appId, $appData['repair-steps']['pre-migration']); @@ -1061,7 +1063,6 @@ class OC_App { self::loadApp($appId); include $appPath . '/appinfo/update.php'; } - self::registerAutoloading($appId, $appPath); self::setupBackgroundJobs($appData['background-jobs']); if(isset($appData['settings']) && is_array($appData['settings'])) { \OC::$server->getSettingsManager()->setupSettings($appData['settings']);