Use memcache flush in the new PHP class.
This commit is contained in:
parent
a70aebcef8
commit
4c2225828b
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue