diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2025-04-29 17:32:15 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2025-04-29 17:32:15 +0200 |
commit | 77455a0357a1e795adfbfbe741dd1c1eb8cd6d4d (patch) | |
tree | a2bfc97d5636e57faa06a4cf9014b580a68c8584 | |
parent | 07b03c426f5d7cda94422cd87515aab307388491 (diff) | |
download | nextcloud-server-77455a0357a1e795adfbfbe741dd1c1eb8cd6d4d.tar.gz nextcloud-server-77455a0357a1e795adfbfbe741dd1c1eb8cd6d4d.zip |
fix: Fix several side effects of lazy ghosts
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
-rw-r--r-- | lib/base.php | 7 | ||||
-rw-r--r-- | lib/private/AppFramework/Utility/SimpleContainer.php | 3 | ||||
-rw-r--r-- | lib/public/AppFramework/App.php | 6 |
3 files changed, 15 insertions, 1 deletions
diff --git a/lib/base.php b/lib/base.php index aa463e206a3..919b7e47fb2 100644 --- a/lib/base.php +++ b/lib/base.php @@ -784,7 +784,12 @@ class OC { if ($systemConfig->getValue('installed', false)) { $appManager->loadApp('settings'); /* Build core application to make sure that listeners are registered */ - Server::get(\OC\Core\Application::class); + $coreApplication = Server::get(\OC\Core\Application::class); + if (PHP_VERSION_ID >= 80400) { + /* FIXME On 8.4 constructor is not called unless we do that or use the object */ + $reflector = new \ReflectionClass(\OC\Core\Application::class); + $reflector->initializeLazyObject($coreApplication); + } } //make sure temporary files are cleaned up diff --git a/lib/private/AppFramework/Utility/SimpleContainer.php b/lib/private/AppFramework/Utility/SimpleContainer.php index 0e46dd71e0d..4558c7417cf 100644 --- a/lib/private/AppFramework/Utility/SimpleContainer.php +++ b/lib/private/AppFramework/Utility/SimpleContainer.php @@ -100,6 +100,9 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer { if ($parameter->allowsNull() && ($parameterType instanceof ReflectionNamedType)) { return null; } + + // don't lose the error we got while trying to query by type + throw new QueryException($e->getMessage(), (int)$e->getCode(), $e); } } diff --git a/lib/public/AppFramework/App.php b/lib/public/AppFramework/App.php index 06404baea70..052bfda865b 100644 --- a/lib/public/AppFramework/App.php +++ b/lib/public/AppFramework/App.php @@ -70,6 +70,12 @@ class App { $step['args'][1] === $classNameParts[1]) { $setUpViaQuery = true; break; + } elseif (isset($step['class'], $step['function'], $step['args'][0]) && + $step['class'] === \ReflectionClass::class && + $step['function'] === 'initializeLazyObject' && + $step['args'][0] === $this) { + $setUpViaQuery = true; + break; } } |