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; } 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) { $service = $this->container->get($id); if ($service instanceof HasHooks) { $service->registerHooks(); } } /** * Fires after the FREE Dankon plugin has fully booted and all of its * services are registered. PRO add-ons listen here to extend the shared * container and register their own hooks. * * @param Plugin $plugin The booted plugin instance. */ do_action('tipping/booted', $this); } }