X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2Fsql.php;h=1aceaced52a4329ac56a882b7191f6373bdf076d;hb=b114e482f08e460bd4e4f894700330fb458112eb;hp=a93e51fe5ace013278f008702b46dac388a35c18;hpb=e77a09ccdbf367c78ebbdc0f846f8698d021c070;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/sql.php b/maintenance/sql.php index a93e51fe5a..1aceaced52 100644 --- a/maintenance/sql.php +++ b/maintenance/sql.php @@ -32,8 +32,8 @@ require_once __DIR__ . '/Maintenance.php'; class MwSql extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = "Send SQL queries to a MediaWiki database. " . - "Takes a file name containing SQL as argument or runs interactively."; + $this->addDescription( 'Send SQL queries to a MediaWiki database. ' . + 'Takes a file name containing SQL as argument or runs interactively.' ); $this->addOption( 'query', 'Run a single query instead of running interactively', false, true ); $this->addOption( 'cluster', 'Use an external cluster by name', false, true ); $this->addOption( 'wikidb', 'The database wiki ID to use if not the current one', false, true ); @@ -71,7 +71,7 @@ class MwSql extends Maintenance { $index = DB_MASTER; } // Get a DB handle (with this wiki's DB selected) from the appropriate load balancer - $db = $lb->getConnection( $index, array(), $wiki ); + $db = $lb->getConnection( $index, [], $wiki ); if ( $this->hasOption( 'slave' ) && $db->getLBInfo( 'master' ) !== null ) { $this->error( "The server selected ({$db->getServer()}) is not a slave.", 1 ); } @@ -82,7 +82,7 @@ class MwSql extends Maintenance { $this->error( "Unable to open input file", true ); } - $error = $db->sourceStream( $file, false, array( $this, 'sqlPrintResult' ) ); + $error = $db->sourceStream( $file, false, [ $this, 'sqlPrintResult' ] ); if ( $error !== true ) { $this->error( $error, true ); } else {