refactor: Divi-Boot-Schritte in DiviIntegration::boot() (Bootable) – Upgrader-Hook, Prüf-Route, CLI und Reiter „Divi“ über lit_mcp_admin_tabs; IntegrationRegistry::boot() bootet jede Integration genau einmal; Prüfseiten-Aufräumen im load-Hook statt beim Rendern

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jan-Niclas Loosen
2026-10-18 21:53:04 +02:00
co-authored by Claude Opus 5.5
parent 06148fb8c1
commit 6c59934caa
10 changed files with 293 additions and 37 deletions
+21
View File
@@ -16,11 +16,32 @@ final class IntegrationRegistry
/** @var list<array{Integration, list<Ability>}>|null Available integrations with their abilities. */
private ?array $loaded = null;
private bool $booted = false;
public function __construct(Integration ...$integrations)
{
$this->integrations = array_values($integrations);
}
/**
* Boots every Bootable integration once, in registry order – available or not: Plugin boots on plugins_loaded,
* before the theme (Divi) is loaded, so isAvailable() is not known yet (as the hooks were registered before
* Bootable). A second call does nothing.
*/
public function boot(): void
{
if ($this->booted) {
return;
}
$this->booted = true;
foreach ($this->integrations as $integration) {
if ($integration instanceof Bootable) {
$integration->boot();
}
}
}
/** @return list<Integration> */
public function available(): array
{