diff options
author | Robin Appelman <robin@icewind.nl> | 2020-08-06 16:48:06 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2020-08-07 11:04:47 +0200 |
commit | 246ed35d948e9b2fe4d8eb38378ba4873bafe2b9 (patch) | |
tree | 1209830594e04ac0308e2e47e7741d8461be0f99 /lib | |
parent | a4d511d82767f54af086b366a6c08bc927cb870c (diff) | |
download | nextcloud-server-246ed35d948e9b2fe4d8eb38378ba4873bafe2b9.tar.gz nextcloud-server-246ed35d948e9b2fe4d8eb38378ba4873bafe2b9.zip |
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/AppFramework/Bootstrap/Coordinator.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/private/AppFramework/Bootstrap/Coordinator.php b/lib/private/AppFramework/Bootstrap/Coordinator.php index 358e71d7854..e293ef2998e 100644 --- a/lib/private/AppFramework/Bootstrap/Coordinator.php +++ b/lib/private/AppFramework/Bootstrap/Coordinator.php @@ -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)) { |