11--TEST--
2- Memcached::get() with cache callback
2+ MemcachedServer
33--SKIPIF--
44<?php
55if (!extension_loaded ("memcached " )) {
66 die ("skip memcached is not loaded \n" );
77}
8+ if (!class_exists ("MemcachedServer " )) {
9+ die ("skip memcached not built with libmemcachedprotocol support \n" );
10+ }
811?>
912--FILE--
1013<?php
@@ -31,8 +34,9 @@ var_dump($cache->get('get_this'));
3134$ cache ->set ('set_key ' , 'value 1 ' , 100 );
3235$ cache ->replace ('replace_key ' , 'value 2 ' , 200 );
3336
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 " ));
3640
3741$ cache ->quit ();
3842
@@ -55,5 +59,26 @@ client_id=[%s]: Noop
5559string(20) "Hello to you client!"
5660client_id=[%s]: Set key=[set_key], value=[value 1], flags=[0], expiration=[100], cas=[0]
5761client_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+ }
5883client_id=[%s]: Client quit
5984Done
0 commit comments