From efcf246f0787d980b85d9cb89e1d15114774d4a5 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 13 Jan 2020 15:12:04 +0100 Subject: [PATCH 1/2] Register the namespace after reading the new file Signed-off-by: Joas Schilling --- lib/private/legacy/app.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index b20fd8543c..16890fe743 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -900,10 +900,11 @@ class OC_App { if($appPath === false) { return false; } - self::registerAutoloading($appId, $appPath); \OC::$server->getAppManager()->clearAppsCache(); $appData = self::getAppInfo($appId); + + self::registerAutoloading($appId, $appPath); self::executeRepairSteps($appId, $appData['repair-steps']['pre-migration']); if (file_exists($appPath . '/appinfo/database.xml')) { From df9edf0108d1374b01c85ade946df85e880dfa9a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 13 Jan 2020 15:14:56 +0100 Subject: [PATCH 2/2] Allow to force register the namespace Signed-off-by: Joas Schilling --- lib/private/legacy/app.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index 16890fe743..961e51fe73 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -227,10 +227,11 @@ class OC_App { * @internal * @param string $app * @param string $path + * @param bool $force */ - public static function registerAutoloading(string $app, string $path) { + public static function registerAutoloading(string $app, string $path, bool $force = false) { $key = $app . '-' . $path; - if(isset(self::$alreadyRegistered[$key])) { + if (!$force && isset(self::$alreadyRegistered[$key])) { return; } @@ -904,7 +905,7 @@ class OC_App { \OC::$server->getAppManager()->clearAppsCache(); $appData = self::getAppInfo($appId); - self::registerAutoloading($appId, $appPath); + self::registerAutoloading($appId, $appPath, true); self::executeRepairSteps($appId, $appData['repair-steps']['pre-migration']); if (file_exists($appPath . '/appinfo/database.xml')) {