diff --git a/controller/action/OpsActions.class.php b/controller/action/OpsActions.class.php index 78b0578b..46c9605d 100644 --- a/controller/action/OpsActions.class.php +++ b/controller/action/OpsActions.class.php @@ -4,13 +4,11 @@ class OpsActions extends Actions { public static function executeClearCache(): array { - if (!ini_get('apc.enabled') || !function_exists('apc_clear_cache')) { + if (!Apc::isEnabled()) { return View::renderJson(['success' => false, 'error' => 'Cache not enabled']); } - apc_clear_cache(); - apc_clear_cache('user'); - apc_clear_cache('opcode'); + apcu_clear_cache(); return View::renderJson(['success' => true]); } diff --git a/lib/tools/CurlWithCache.class.php b/lib/tools/CurlWithCache.class.php index 63b896c4..01682f5f 100644 --- a/lib/tools/CurlWithCache.class.php +++ b/lib/tools/CurlWithCache.class.php @@ -14,7 +14,7 @@ class CurlWithCache extends Curl $cacheKey = $cacheEnabled ? md5($url . $method . serialize($options) . serialize($params)) : null; if ($cacheAllowed && $cacheKey) { - $cachedData = apc_fetch($cacheKey); + $cachedData = apcu_fetch($cacheKey); if ($cachedData) { return $cachedData; } @@ -24,9 +24,9 @@ class CurlWithCache extends Curl if ($cacheEnabled) { if ($cacheAllowed) { - apc_store($cacheKey, $response, $cacheTimeout); + apcu_store($cacheKey, $response, $cacheTimeout); } else { - apc_delete($cacheKey); + apcu_delete($cacheKey); } }