only boot apps once

in some cases `loadApp` is called more then once which is currently causing apps to be "booted" multiple times which can lead to unexepected behaviour with things like registering hooks

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2020-08-06 16:48:06 +02:00 committed by Morris Jobke
parent a4d511d827
commit 246ed35d94
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68

View File

@ -60,6 +60,9 @@ class Coordinator {
/** @var RegistrationContext|null */
private $registrationContext;
/** @var string[] */
private $bootedApps = [];
public function __construct(IServerContainer $container,
Registry $registry,
IManager $dashboardManager,
@ -134,6 +137,11 @@ class Coordinator {
}
public function bootApp(string $appId): void {
if (isset($this->bootedApps[$appId])) {
return;
}
$this->bootedApps[$appId] = true;
$appNameSpace = App::buildAppNamespace($appId);
$applicationClassName = $appNameSpace . '\\AppInfo\\Application';
if (!class_exists($applicationClassName)) {