Ensure apcu_cache_info function is available before calling (#7323)
This commit is contained in:
parent
1572c76963
commit
6d356194ba
|
|
@ -447,12 +447,14 @@ class settings implements clear_cache {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function clear_cache() {
|
public static function clear_cache() {
|
||||||
$cache = apcu_cache_info(false);
|
if (function_exists('apcu_enabled') && apcu_enabled()) {
|
||||||
if (!empty($cache['cache_list'])) {
|
$cache = apcu_cache_info(false);
|
||||||
foreach ($cache['cache_list'] as $entry) {
|
if (!empty($cache['cache_list'])) {
|
||||||
$key = $entry['info'];
|
foreach ($cache['cache_list'] as $entry) {
|
||||||
if (str_starts_with($key, 'settings_')) {
|
$key = $entry['info'];
|
||||||
apcu_delete($key);
|
if (str_starts_with($key, 'settings_')) {
|
||||||
|
apcu_delete($key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue