diff options
Diffstat (limited to 'maintenance/mcc.php')
-rwxr-xr-x | maintenance/mcc.php | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/maintenance/mcc.php b/maintenance/mcc.php index a6b524916ac5..6ebbfc1b35f7 100755 --- a/maintenance/mcc.php +++ b/maintenance/mcc.php @@ -1,10 +1,10 @@ <?php -require_once( "../includes/DefaultSettings.php" ); -require_once( "../LocalSettings.php" ); -require_once( "../includes/MemCachedClient.inc.php" ); -$mcc = new MemCachedClient(); +require_once( "commandLine.inc" ); + +$mcc = new memcached( array('persistant' => true) ); $mcc->set_servers( $wgMemCachedServers ); +$mcc->set_debug( true ); do { $bad = false; @@ -20,7 +20,8 @@ do { $res = $res[$args[1]]; } if ( $res === false ) { - print 'Error: ' . $mcc->error_string() . "\n"; + #print 'Error: ' . $mcc->error_string() . "\n"; + print "MemCached error\n"; } elseif ( is_string( $res ) ) { print "$res\n"; } else { @@ -35,13 +36,15 @@ do { $value = implode( " ", $args ); } if ( !$mcc->set( $key, $value, 0 ) ) { - print 'Error: ' . $mcc->error_string() . "\n"; + #print 'Error: ' . $mcc->error_string() . "\n"; + print "MemCached error\n"; } break; case "delete": $key = implode( " ", $args ); if ( !$mcc->delete( $key ) ) { - print 'Error: ' . $mcc->error_string() . "\n"; + #print 'Error: ' . $mcc->error_string() . "\n"; + print "MemCached error\n"; } break; case "quit": @@ -61,19 +64,5 @@ do { } } while ( !$quit ); -function readconsole( $prompt = "" ) { - if ( function_exists( "readline" ) ) { - return readline( $prompt ); - } else { - print $prompt; - $fp = fopen( "php://stdin", "r" ); - $resp = trim( fgets( $fp, 1024 ) ); - fclose( $fp ); - return $resp; - } -} - - - ?> |