Use memcache flush in the new PHP class.

This commit is contained in:
Mark Crane 2015-01-16 08:25:54 +00:00
parent a70aebcef8
commit 4c2225828b
2 changed files with 12 additions and 3 deletions

View File

@ -60,8 +60,8 @@ else {
//memcache flush
if ($cmd == "api memcache flush") {
$response = event_socket_request($fp, $cmd);
unset($cmd);
$cache = new cache;
$cache->flush();
}
//reloadacl

View File

@ -96,7 +96,16 @@ class cache {
*/
public function flush() {
//send a custom event
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
$event = "sendevent CUSTOM\n";
$event .= "Event-Name: MEMCACHE\n";
$event .= "Event-Subclass: flush\n";
$event .= "API-Command: memcache\n";
$event .= "API-Command-Argument: flush\n";
echo event_socket_request($fp, $event);
}
//run the memcache
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {