X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fmcc.php;h=e70060e2f693f19a55ca2f673b43606b94821ed1;hb=28a23740d89cf8aa1bcca7cde04366477e543de8;hp=7b7b761445264b834f7ed7192a954b8ed4051171;hpb=9e0e8abd7eac4c16b22a0ff7c8381f0f7ecccf64;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/mcc.php b/maintenance/mcc.php index 7b7b761445..e70060e2f6 100644 --- a/maintenance/mcc.php +++ b/maintenance/mcc.php @@ -22,23 +22,24 @@ * @ingroup Maintenance */ -/** */ +$optionsWithArgs = [ 'cache' ]; +$optionsWithoutArgs = [ + 'debug', 'help' +]; require_once __DIR__ . '/commandLine.inc'; -$options = getopt( '', array( 'debug', 'help', 'cache:' ) ); - $debug = isset( $options['debug'] ); $help = isset( $options['help'] ); -$cache = isset( $options['cache'] ) ? $options['cache'] : null; +$cache = $options['cache'] ?? null; if ( $help ) { mccShowUsage(); exit( 0 ); } -$mcc = new MWMemcached( array( +$mcc = new MemcachedClient( [ 'persistent' => true, 'debug' => $debug, -) ); +] ); if ( $cache ) { if ( !isset( $wgObjectCaches[$cache] ) ) { @@ -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'; }