Code clarity tweak
[lhc/web/wiklou.git] / maintenance / mcc.php
index b0302ab..909d7ca 100644 (file)
@@ -2,15 +2,15 @@
 /**
  * memcached diagnostic tool
  *
+ * @file
  * @todo document
- * @addtogroup Maintenance
+ * @ingroup Maintenance
  */
 
 /** */
-require_once( 'commandLine.inc' );
-require_once( 'memcached-client.php' );
+require_once( dirname(__FILE__) . '/commandLine.inc' );
 
-$mcc = new memcached( array('persistant' => true/*, 'debug' => true*/) );
+$mcc = new MWMemcached( array('persistant' => true/*, 'debug' => true*/) );
 $mcc->set_servers( $wgMemCachedServers );
 #$mcc->set_debug( true );
 
@@ -88,7 +88,11 @@ do {
                break;
 
                case 'get':
-                       print "Getting {$args[0]}[{$args[1]}]\n";
+                       $sub = '';
+                       if ( array_key_exists( 1, $args ) ) {
+                               $sub = $args[1];
+                       }
+                       print "Getting {$args[0]}[$sub]\n";
                        $res = $mcc->get( $args[0] );
                        if ( array_key_exists( 1, $args ) ) {
                                $res = $res[$args[1]];
@@ -173,4 +177,4 @@ do {
        }
 } while ( !$quit );
 
-?>
+