1
1
--TEST--
2
- Memcached::get() with cache callback
2
+ MemcachedServer
3
3
--SKIPIF--
4
4
<?php
5
5
if (!extension_loaded ("memcached " )) {
6
6
die ("skip memcached is not loaded \n" );
7
7
}
8
+ if (!class_exists ("MemcachedServer " )) {
9
+ die ("skip memcached not built with libmemcachedprotocol support \n" );
10
+ }
8
11
?>
9
12
--FILE--
10
13
<?php
@@ -31,8 +34,9 @@ var_dump($cache->get('get_this'));
31
34
$ cache ->set ('set_key ' , 'value 1 ' , 100 );
32
35
$ cache ->replace ('replace_key ' , 'value 2 ' , 200 );
33
36
34
- // TODO var_dump($cache->getVersion());
35
- // TODO var_dump($cache->getStats());
37
+ var_dump ($ cache ->getVersion ());
38
+ var_dump ($ cache ->getStats ());
39
+ var_dump ($ cache ->getStats ("foobar " ));
36
40
37
41
$ cache ->quit ();
38
42
@@ -55,5 +59,26 @@ client_id=[%s]: Noop
55
59
string(20) "Hello to you client!"
56
60
client_id=[%s]: Set key=[set_key], value=[value 1], flags=[0], expiration=[100], cas=[0]
57
61
client_id=[%s]: Replace key=[replace_key], value=[value 2], flags=[0], expiration=[200], cas=[0]
62
+ client_id=[%s]: Version
63
+ array(1) {
64
+ ["127.0.0.1:3434"]=>
65
+ string(5) "1.1.1"
66
+ }
67
+ client_id=[%s]: Stat key=[]
68
+ array(1) {
69
+ ["127.0.0.1:3434"]=>
70
+ array(1) {
71
+ [""]=>
72
+ string(15) "Stat reply for "
73
+ }
74
+ }
75
+ client_id=[%s]: Stat key=[foobar]
76
+ array(1) {
77
+ ["127.0.0.1:3434"]=>
78
+ array(1) {
79
+ ["foobar"]=>
80
+ string(21) "Stat reply for foobar"
81
+ }
82
+ }
58
83
client_id=[%s]: Client quit
59
84
Done
0 commit comments