Index: trunk/phase3/maintenance/mcc.php |
— | — | @@ -11,9 +11,9 @@ |
12 | 12 | require_once( 'commandLine.inc' ); |
13 | 13 | require_once( 'memcached-client.php' ); |
14 | 14 | |
15 | | -$mcc = new memcached( array('persistant' => true, 'debug' => true) ); |
| 15 | +$mcc = new memcached( array('persistant' => true/*, 'debug' => true*/) ); |
16 | 16 | $mcc->set_servers( $wgMemCachedServers ); |
17 | | -$mcc->set_debug( true ); |
| 17 | +#$mcc->set_debug( true ); |
18 | 18 | |
19 | 19 | function mccShowHelp($command) { |
20 | 20 | |
— | — | @@ -46,6 +46,10 @@ |
47 | 47 | print "history: show command line history\n"; |
48 | 48 | if($onlyone) { break; } |
49 | 49 | |
| 50 | + case 'server': |
| 51 | + print "server: show current memcached server\n"; |
| 52 | + if($onlyone) { break; } |
| 53 | + |
50 | 54 | case 'dumpmcc': |
51 | 55 | print "dumpmcc: shows the whole thing\n"; |
52 | 56 | if($onlyone) { break; } |
— | — | @@ -73,7 +77,7 @@ |
74 | 78 | |
75 | 79 | $line = readconsole( '> ' ); |
76 | 80 | if ($line === false) exit; |
77 | | - |
| 81 | + |
78 | 82 | $args = explode( ' ', $line ); |
79 | 83 | $command = array_shift( $args ); |
80 | 84 | |
— | — | @@ -106,6 +110,11 @@ |
107 | 111 | var_dump( $sock ); |
108 | 112 | break; |
109 | 113 | |
| 114 | + case 'server': |
| 115 | + $res = $mcc->get( $args[0] ); |
| 116 | + print $mcc->_buckets[$mcc->_hashfunc( $args[0] ) % $mcc->_bucketcount] . "\n"; |
| 117 | + break; |
| 118 | + |
110 | 119 | case 'set': |
111 | 120 | $key = array_shift( $args ); |
112 | 121 | if ( $args[0] == "#" && is_numeric( $args[1] ) ) { |