X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fmcc.php;h=784ba0ea357496bee9c3d0118a0331561587e40a;hb=899f475d0dad8ea0a24f706fc8ac07e3097d6191;hp=6ff8a176d0d9933147921c3342834ef7d54c6cb2;hpb=9a4bef5f14562fc3c5e72d7177a51eae914f53e0;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/mcc.php b/maintenance/mcc.php index 6ff8a176d0..784ba0ea35 100644 --- a/maintenance/mcc.php +++ b/maintenance/mcc.php @@ -22,10 +22,11 @@ * @ingroup Maintenance */ -/** */ -require_once( __DIR__ . '/commandLine.inc' ); - -$options = getopt( '', array( 'debug', 'help', 'cache:' ) ); +$optionsWithArgs = [ 'cache' ]; +$optionsWithoutArgs = [ + 'debug', 'help' +]; +require_once __DIR__ . '/commandLine.inc'; $debug = isset( $options['debug'] ); $help = isset( $options['help'] ); @@ -35,10 +36,10 @@ if ( $help ) { mccShowUsage(); exit( 0 ); } -$mcc = new MWMemcached( array( +$mcc = new MemcachedClient( [ 'persistent' => true, 'debug' => $debug, -) ); +] ); if ( $cache ) { if ( !isset( $wgObjectCaches[$cache] ) ) { @@ -48,7 +49,7 @@ if ( $cache ) { $servers = $wgObjectCaches[$cache]['servers']; } elseif ( $wgMainCacheType === CACHE_MEMCACHED ) { $mcc->set_servers( $wgMemCachedServers ); -} elseif( isset( $wgObjectCaches[$wgMainCacheType]['servers'] ) ) { +} elseif ( isset( $wgObjectCaches[$wgMainCacheType]['servers'] ) ) { $mcc->set_servers( $wgObjectCaches[$wgMainCacheType]['servers'] ); } else { print "MediaWiki isn't configured for Memcached usage\n"; @@ -81,7 +82,7 @@ EOF; function mccGetHelp( $command ) { $output = ''; - $commandList = array( + $commandList = [ 'get' => 'grabs something', 'getsock' => 'lists sockets', 'set' => 'changes something', @@ -92,7 +93,7 @@ function mccGetHelp( $command ) { 'exit' => 'exit mcc', 'quit' => 'exit mcc', 'help' => 'help about a command', - ); + ]; if ( !$command ) { $command = 'fullhelp'; } @@ -116,7 +117,9 @@ do { $quit = false; $line = Maintenance::readconsole(); - if ( $line === false ) exit; + if ( $line === false ) { + exit; + } $args = explode( ' ', $line ); $command = array_shift( $args );