From 7a924f85b82a0da7a52faf4e6a5767797b71d0c4 Mon Sep 17 00:00:00 2001 From: Tim Fry Date: Sat, 15 Mar 2025 01:57:25 -0300 Subject: [PATCH] use new interface to trigger a cache flush --- resources/classes/settings.php | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/resources/classes/settings.php b/resources/classes/settings.php index f0105c68a9..3a29f81751 100644 --- a/resources/classes/settings.php +++ b/resources/classes/settings.php @@ -446,31 +446,13 @@ class settings { } } - /** - * Clears the settings cache - * @param string $type Empty clears all settings. Values can be global, domain, or user. - */ - public static function clear_cache(string $type = '') { - if (function_exists('apcu_enabled') && apcu_enabled()) { - switch ($type) { - case 'all': - case '': - default: - $type = ""; - break; - case 'global': - case 'domain': - case 'user': - $type .= "_"; - break; - } - $cache = apcu_cache_info(false); - if (!empty($cache['cache_list'])) { - foreach ($cache['cache_list'] as $entry) { - $key = $entry['info']; - if (str_starts_with($key, 'settings_' . $type)) { - apcu_delete($key); - } + public static function clear_cache() { + $cache = apcu_cache_info(false); + if (!empty($cache['cache_list'])) { + foreach ($cache['cache_list'] as $entry) { + $key = $entry['info']; + if (str_starts_with($key, 'settings_')) { + apcu_delete($key); } } }