r11928 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r11927‎ | r11928 | r11929 >
Date:18:14, 3 December 2005
Author:hashar
Status:old
Tags:
Comment:
'server' command from live
Modified paths:
  • /trunk/phase3/maintenance/mcc.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/mcc.php
@@ -11,9 +11,9 @@
1212 require_once( 'commandLine.inc' );
1313 require_once( 'memcached-client.php' );
1414
15 -$mcc = new memcached( array('persistant' => true, 'debug' => true) );
 15+$mcc = new memcached( array('persistant' => true/*, 'debug' => true*/) );
1616 $mcc->set_servers( $wgMemCachedServers );
17 -$mcc->set_debug( true );
 17+#$mcc->set_debug( true );
1818
1919 function mccShowHelp($command) {
2020
@@ -46,6 +46,10 @@
4747 print "history: show command line history\n";
4848 if($onlyone) { break; }
4949
 50+ case 'server':
 51+ print "server: show current memcached server\n";
 52+ if($onlyone) { break; }
 53+
5054 case 'dumpmcc':
5155 print "dumpmcc: shows the whole thing\n";
5256 if($onlyone) { break; }
@@ -73,7 +77,7 @@
7478
7579 $line = readconsole( '> ' );
7680 if ($line === false) exit;
77 -
 81+
7882 $args = explode( ' ', $line );
7983 $command = array_shift( $args );
8084
@@ -106,6 +110,11 @@
107111 var_dump( $sock );
108112 break;
109113
 114+ case 'server':
 115+ $res = $mcc->get( $args[0] );
 116+ print $mcc->_buckets[$mcc->_hashfunc( $args[0] ) % $mcc->_bucketcount] . "\n";
 117+ break;
 118+
110119 case 'set':
111120 $key = array_shift( $args );
112121 if ( $args[0] == "#" && is_numeric( $args[1] ) ) {

Status & tagging log