Web: Register hooks provided by the app when bootstrapping

This commit is contained in:
Yonas Habteab 2022-05-06 08:50:45 +02:00
parent 2c67b0db03
commit 7b451a8e3e

View File

@ -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.