Update cache.php

This commit is contained in:
FusionPBX 2019-10-15 13:54:55 -06:00 committed by GitHub
parent 00133fb0e3
commit a6eb416982
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 13 deletions

View File

@ -40,13 +40,13 @@ class cache {
if ($fp === false) {
return false;
}
//send a custom event
//run the memcache
$command = "memcache set ".$key." ".$value;
$result = event_socket_request($fp, 'api '.$command);
//close event socket
fclose($fp);
}
@ -58,7 +58,7 @@ class cache {
}
}
// return result
//return result
return $result;
}
@ -75,26 +75,26 @@ class cache {
if ($fp === false) {
return false;
}
//send a custom event
//run the memcache
$command = "memcache get ".$key;
$result = event_socket_request($fp, 'api '.$command);
//close event socket
fclose($fp);
}
//get the file cache
if ($_SESSION['cache']['method']['text'] == "file") {
if (file_exists($_SESSION['cache']['location']['text'] . "/" . $key)) {
$result = file_get_contents($_SESSION['cache']['location']['text'] . "/" . $key);
}
}
// return result
//return result
return $result;
}
@ -187,7 +187,6 @@ class cache {
//close event socket
fclose($fp);
}
//cache method file
@ -202,10 +201,9 @@ class cache {
//remove the cache
recursive_delete($_SESSION['cache']['location']['text']);
}
// return result
//return result
return $result;
}
}