Skip to content

Commit 4c8daea

Browse files
committed
fix(files_external): Fix registration of listeners with PHP >= 8.4
With the lazy ghosts the constructor is not always called in files_external boot. This is a quick and dirty fix but we should instead move the code out of the constructors and to the boot method. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 parent d400b38 commit 4c8daea

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apps/files_external/lib/AppInfo/Application.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,11 @@ public function boot(IBootContext $context): void {
8989

9090
// force-load auth mechanisms since some will register hooks
9191
// TODO: obsolete these and use the TokenProvider to get the user's password from the session
92-
$this->getAuthMechanisms();
92+
$objects = $this->getAuthMechanisms();
93+
foreach ($objects as $object) {
94+
/* Use the object to trigger DI on PHP >= 8.4 */
95+
get_object_vars($object);
96+
}
9397
}
9498

9599
/**

0 commit comments

Comments
 (0)