From a303e4966ddccfe385d04b9bb081f88ad0b4f543 Mon Sep 17 00:00:00 2001 From: pandawabot Date: Fri, 9 Sep 2022 13:41:01 +0000 Subject: [PATCH] chore: various updates --- Bundle/Bundle.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Bundle/Bundle.php b/Bundle/Bundle.php index 2baa3a9..6513bc2 100644 --- a/Bundle/Bundle.php +++ b/Bundle/Bundle.php @@ -58,6 +58,10 @@ abstract class Bundle implements BundleContract */ private array $initializedPlugins = []; + private bool $pluginConfigured = false; + + private bool $pluginBooted = false; + public function __construct(protected Application $app) { if ($this instanceof HasPluginInterface) { @@ -207,6 +211,12 @@ public function isDeferred(): bool public function configurePlugin(): void { + if ($this->pluginConfigured) { + return; + } + + $this->pluginConfigured = true; + foreach ($this->initializedPlugins as $plugin) { $plugin->configure(); } @@ -222,6 +232,12 @@ public function configure(): void public function bootPlugin(): void { + if ($this->pluginBooted) { + return; + } + + $this->pluginBooted = true; + foreach ($this->initializedPlugins as $plugin) { $plugin->boot(); }