Use memcache flush in the new PHP class.
This commit is contained in:
parent
a70aebcef8
commit
4c2225828b
|
|
@ -60,8 +60,8 @@ else {
|
||||||
|
|
||||||
//memcache flush
|
//memcache flush
|
||||||
if ($cmd == "api memcache flush") {
|
if ($cmd == "api memcache flush") {
|
||||||
$response = event_socket_request($fp, $cmd);
|
$cache = new cache;
|
||||||
unset($cmd);
|
$cache->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
//reloadacl
|
//reloadacl
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,16 @@ class cache {
|
||||||
*/
|
*/
|
||||||
public function flush() {
|
public function flush() {
|
||||||
//send a custom event
|
//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
|
//run the memcache
|
||||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||||
if ($fp) {
|
if ($fp) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue