From 19686725dc810f63a07f049f82c66cf336d90ca6 Mon Sep 17 00:00:00 2001 From: slawkens Date: Sun, 2 Feb 2025 16:17:49 +0100 Subject: [PATCH] Add HOOK_INIT, executed just after $hooks are loaded --- system/init.php | 1 + system/src/global.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/system/init.php b/system/init.php index 8c7e56fc..ba2990db 100644 --- a/system/init.php +++ b/system/init.php @@ -50,6 +50,7 @@ $cache = Cache::getInstance(); global $hooks; $hooks = new Hooks(); $hooks->load(); +$hooks->trigger(HOOK_INIT); // twig require_once SYSTEM . 'twig.php'; diff --git a/system/src/global.php b/system/src/global.php index d5c54fd8..61b887b5 100644 --- a/system/src/global.php +++ b/system/src/global.php @@ -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