X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FupdateCollation.php;h=e754e3c3abb3d6080717909fbf717e15e511ecc8;hb=11ee7f78da9776db26098642a151a288f98bea14;hp=930f533f95227e45fdb8e15be9f40117a98da25f;hpb=cb0ceb631f36571a9faad3255ce1e43512a09631;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/updateCollation.php b/maintenance/updateCollation.php index 930f533f95..63176cb6ef 100644 --- a/maintenance/updateCollation.php +++ b/maintenance/updateCollation.php @@ -26,6 +26,8 @@ require_once __DIR__ . '/Maintenance.php'; +use Wikimedia\Rdbms\IDatabase; + /** * Maintenance script that will find all rows in the categorylinks table * whose collation is out-of-date. @@ -34,7 +36,7 @@ require_once __DIR__ . '/Maintenance.php'; */ class UpdateCollation extends Maintenance { const BATCH_SIZE = 100; // Number of rows to process in one batch - const SYNC_INTERVAL = 5; // Wait for slaves after this many batches + const SYNC_INTERVAL = 5; // Wait for replica DBs after this many batches public $sizeHistogram = []; @@ -70,7 +72,7 @@ TEXT global $wgCategoryCollation; $dbw = $this->getDB( DB_MASTER ); - $dbr = $this->getDB( DB_SLAVE ); + $dbr = $this->getDB( DB_REPLICA ); $force = $this->getOption( 'force' ); $dryRun = $this->getOption( 'dry-run' ); $verboseStats = $this->getOption( 'verbose-stats' ); @@ -224,7 +226,7 @@ TEXT $this->output( "$count done.\n" ); if ( !$dryRun && ++$batchCount % self::SYNC_INTERVAL == 0 ) { - $this->output( "Waiting for slaves ... " ); + $this->output( "Waiting for replica DBs ... " ); wfWaitForSlaves(); $this->output( "done\n" ); } @@ -242,7 +244,7 @@ TEXT * Return an SQL expression selecting rows which sort above the given row, * assuming an ordering of cl_collation, cl_to, cl_type, cl_from * @param stdClass $row - * @param DatabaseBase $dbw + * @param IDatabase $dbw * @return string */ function getBatchCondition( $row, $dbw ) { @@ -342,5 +344,5 @@ TEXT } } -$maintClass = "UpdateCollation"; +$maintClass = UpdateCollation::class; require_once RUN_MAINTENANCE_IF_MAIN;