diff --git a/app/sip_status/cmd.php b/app/sip_status/cmd.php index ee92f708b1..57c5c8e93a 100644 --- a/app/sip_status/cmd.php +++ b/app/sip_status/cmd.php @@ -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 diff --git a/resources/classes/cache.php b/resources/classes/cache.php index 586f09e7ea..689fe7199a 100644 --- a/resources/classes/cache.php +++ b/resources/classes/cache.php @@ -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) {