LibreY- privacy respecting meta search engine |
git clone git://git.acid.vegas/LibreY.git |
Log | Files | Refs | Archive | README | LICENSE |
commit 11e11192a47b91e22e0f5726a060920b8ede03b5
parent 8bae58c2b28dcc3f9d1eec2291e09a4a76070b85 Author: davidovski <david@davidovski.xyz> Date: Fri, 25 Aug 2023 18:57:23 +0100 Do not persist if apcu is not installed Diffstat:
|
1 file changed, 5 insertions(+), 2 deletions(-) |
diff --git a/misc/cooldowns.php b/misc/cooldowns.php @@ -1,10 +1,13 @@ <?php function load_cooldowns() { - return apcu_exists("cooldowns") ? apcu_fetch("cooldowns") : array(); + if (function_exists(apcu_fetch)) + return apcu_exists("cooldowns") ? apcu_fetch("cooldowns") : array(); + return array(); } function save_cooldowns($cooldowns) { - apcu_store("cooldowns", $cooldowns); + if (function_exists(apcu_fetch)) + apcu_store("cooldowns", $cooldowns); } function set_cooldown($instance, $timeout, $cooldowns) { |