From 7b451a8e3e14dbc9151ddac2573489843835f6f1 Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Fri, 6 May 2022 08:50:45 +0200 Subject: [PATCH] Web: Register hooks provided by the app when bootstrapping --- library/Icinga/Application/Web.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Application/Web.php b/library/Icinga/Application/Web.php index 4ce9b45a6..faff16b2d 100644 --- a/library/Icinga/Application/Web.php +++ b/library/Icinga/Application/Web.php @@ -6,6 +6,7 @@ namespace Icinga\Application; require_once __DIR__ . '/EmbeddedWeb.php'; use ErrorException; +use Icinga\Application\ProvidedHook\LessVarsLoader; use ipl\I18n\GettextTranslator; use ipl\I18n\Locale; use ipl\I18n\StaticTranslator; @@ -101,7 +102,8 @@ class Web extends EmbeddedWeb ->setupUser() ->setupTimezone() ->setupInternationalization() - ->setupFatalErrorHandling(); + ->setupFatalErrorHandling() + ->registerApplicationHooks(); } /** @@ -461,6 +463,18 @@ class Web extends EmbeddedWeb return $this; } + /** + * Register all hooks provided by the main application + * + * @return $this + */ + protected function registerApplicationHooks() + { + Hook::register('Themebuilder\\LessVarsLoader', LessVarsLoader::class, LessVarsLoader::class); + + return $this; + } + /** * (non-PHPDoc) * @see ApplicationBootstrap::detectTimezone() For the method documentation.