container = new Container(); (require __DIR__ . '/../config/services.php')($this->container); } public static function instance(): self { return self::$instance ??= new self(); } public function container(): Container { return $this->container; } /** * Absolute URL to a bundled asset, relative to the plugin root. */ public function url(string $path = ''): string { return TABBY_URL . ltrim($path, '/'); } public function boot(): void { if ($this->booted) { return; } $this->booted = true; $this->container->get(Migrator::class)->maybeMigrate(); /** @var array> $hooks */ $hooks = require __DIR__ . '/../config/hooks.php'; foreach ($hooks as $id) { if (! $this->container->has($id)) { continue; } $service = $this->container->get($id); if ($service instanceof HasHooks) { $service->registerHooks(); } } /** * Fires after Tabby has fully booted: container wired and all base hook * subscribers registered. Add-ons (e.g. Tabvera Pro) listen here to extend * the shared container and register their own hooks. * * @param Plugin $plugin The booted plugin instance. */ do_action('tabby/booted', $this); } }