forked from mtaneja/php-pecl-memcache-zynga
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeleteByKey.php
37 lines (27 loc) · 897 Bytes
/
deleteByKey.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
require_once("init.php");
$memcache = new memcache;
$memcache->debug(DEBUG);
$memcache->addServer("localhost", 11211);
$memcache->addServer("localhost1", 11211);
$memcache->addServer("localhost2", 11211);
$memcache->addServer("localhost3", 11211);
$memcache->addServer("localhost4", 11211);
if ($memcache) {
$time = 0;
$key = "foo";
$shardKey = "foo";
$result = $memcache->deleteByKey($key, $shardKey, $time);
echo "key '$key' shardKey '$shardKey' result '$result' time '$time'\n";
$key = "foo";
$shardKey = "123";
$result = $memcache->deleteByKey($key, $shardKey, $time);
echo "key '$key' shardKey '$shardKey' result '$result' time '$time'\n";
$key = "fa;dfa;dfa;sdf;safoo";
$shardKey = "123";
$result = $memcache->deleteByKey($key, $shardKey, $time);
echo "key '$key' shardKey '$shardKey' result '$result' time '$time'\n";
} else {
echo "Connection failed\n";
}
?>