mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-31 01:23:50 +00:00
Update cache.php
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user