From 25c0bac7a3aeeccb2f3fec41e3dcb989b1ebe861 Mon Sep 17 00:00:00 2001 From: slawkens Date: Sat, 27 Jan 2024 20:30:15 +0100 Subject: [PATCH] Cache clear hook --- system/functions.php | 3 +++ system/src/global.php | 1 + 2 files changed, 4 insertions(+) diff --git a/system/functions.php b/system/functions.php index 7cce4d54..7a807c72 100644 --- a/system/functions.php +++ b/system/functions.php @@ -1254,6 +1254,9 @@ function clearCache() // routes cache clearRouteCache(); + global $hooks; + $hooks->trigger(HOOK_CACHE_CLEAR, ['cache' => Cache::getInstance()]); + return true; } diff --git a/system/src/global.php b/system/src/global.php index 161185b7..3700dee6 100644 --- a/system/src/global.php +++ b/system/src/global.php @@ -73,6 +73,7 @@ define('HOOK_GUILDS_AFTER_GUILD_INFORMATION', ++$i); define('HOOK_GUILDS_AFTER_GUILD_MEMBERS', ++$i); define('HOOK_GUILDS_AFTER_INVITED_CHARACTERS', ++$i); define('HOOK_TWIG', ++$i); +define('HOOK_CACHE_CLEAR', ++$i); const HOOK_FIRST = HOOK_STARTUP; define('HOOK_LAST', $i);