X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fsql.php;h=36e55f3eed52d008e3b9b09de6abd003467121e3;hb=d5a7166771613dfe4ed9fb75fa5efeced6134bd1;hp=e42a8efad0130de9f0bcabe24158365390cd19e1;hpb=7dc9d3dacf1faf2a8ffc69e677afe4ea16c4e92e;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/sql.php b/maintenance/sql.php index e42a8efad0..36e55f3eed 100644 --- a/maintenance/sql.php +++ b/maintenance/sql.php @@ -24,6 +24,10 @@ require_once __DIR__ . '/Maintenance.php'; +use Wikimedia\Rdbms\ResultWrapper; +use Wikimedia\Rdbms\IDatabase; +use Wikimedia\Rdbms\DBQueryError; + /** * Maintenance script that sends SQL queries from the specified file to the database. * @@ -50,7 +54,7 @@ class MwSql extends Maintenance { $wiki = $this->hasOption( 'wikidb' ) ? $this->getOption( 'wikidb' ) : false; // Get the appropriate load balancer (for this wiki) if ( $this->hasOption( 'cluster' ) ) { - $lb = wfGetLBFactory()->getExternalLB( $this->getOption( 'cluster' ), $wiki ); + $lb = wfGetLBFactory()->getExternalLB( $this->getOption( 'cluster' ) ); } else { $lb = wfGetLB( $wiki ); } @@ -74,7 +78,7 @@ class MwSql extends Maintenance { $index = DB_MASTER; } - /** @var Database $db DB handle for the appropriate cluster/wiki */ + /** @var IDatabase $db DB handle for the appropriate cluster/wiki */ $db = $lb->getConnection( $index, [], $wiki ); if ( $replicaDB != '' && $db->getLBInfo( 'master' ) !== null ) { $this->error( "The server selected ({$db->getServer()}) is not a replica DB.", 1 ); @@ -159,7 +163,7 @@ class MwSql extends Maintenance { /** * Print the results, callback for $db->sourceStream() - * @param ResultWrapper $res The results object + * @param ResultWrapper|bool $res The results object * @param IDatabase $db */ public function sqlPrintResult( $res, $db ) {