mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
rename all apc functions
This commit is contained in:
parent
c641c57b0f
commit
e254610262
2 changed files with 5 additions and 7 deletions
|
@ -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]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue