rename all apc functions

This commit is contained in:
Jeremy Kauffman 2018-12-11 16:11:43 -05:00
parent c641c57b0f
commit e254610262
2 changed files with 5 additions and 7 deletions

View file

@ -4,13 +4,11 @@ class OpsActions extends Actions
{ {
public static function executeClearCache(): array 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']); return View::renderJson(['success' => false, 'error' => 'Cache not enabled']);
} }
apc_clear_cache(); apcu_clear_cache();
apc_clear_cache('user');
apc_clear_cache('opcode');
return View::renderJson(['success' => true]); return View::renderJson(['success' => true]);
} }

View file

@ -14,7 +14,7 @@ class CurlWithCache extends Curl
$cacheKey = $cacheEnabled ? md5($url . $method . serialize($options) . serialize($params)) : null; $cacheKey = $cacheEnabled ? md5($url . $method . serialize($options) . serialize($params)) : null;
if ($cacheAllowed && $cacheKey) { if ($cacheAllowed && $cacheKey) {
$cachedData = apc_fetch($cacheKey); $cachedData = apcu_fetch($cacheKey);
if ($cachedData) { if ($cachedData) {
return $cachedData; return $cachedData;
} }
@ -24,9 +24,9 @@ class CurlWithCache extends Curl
if ($cacheEnabled) { if ($cacheEnabled) {
if ($cacheAllowed) { if ($cacheAllowed) {
apc_store($cacheKey, $response, $cacheTimeout); apcu_store($cacheKey, $response, $cacheTimeout);
} else { } else {
apc_delete($cacheKey); apcu_delete($cacheKey);
} }
} }