Add HOOK_INIT, executed just after $hooks are loaded

This commit is contained in:
slawkens 2025-02-02 16:17:49 +01:00
parent a73fb1003e
commit 19686725dc
2 changed files with 3 additions and 1 deletions

View File

@ -50,6 +50,7 @@ $cache = Cache::getInstance();
global $hooks;
$hooks = new Hooks();
$hooks->load();
$hooks->trigger(HOOK_INIT);
// twig
require_once SYSTEM . 'twig.php';

View File

@ -5,6 +5,7 @@ const SKILL_BALANCE = -2;
$i = 0;
define('HOOK_INIT', ++$i);
define('HOOK_STARTUP', ++$i);
define('HOOK_BEFORE_PAGE', ++$i);
define('HOOK_AFTER_PAGE', ++$i);
@ -96,7 +97,7 @@ define('HOOK_CACHE_CLEAR', ++$i);
define('HOOK_INSTALL_FINISH', ++$i);
define('HOOK_INSTALL_FINISH_END', ++$i);
const HOOK_FIRST = HOOK_STARTUP;
const HOOK_FIRST = HOOK_INIT;
define('HOOK_LAST', $i);
function is_sub_dir($path = NULL, $parent_folder = BASE): bool|string