X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FpopulateRecentChangesSource.php;h=8a56d7d8759d971a1a5692801125170473f96926;hb=a7e2b91b2c72f3522a7a9c3c957a43309e70b92e;hp=eb9797f0b016069e5066a4e54f26c0a6eceab5f7;hpb=6f6e7d6dfd5b4c5cdb4f1e4f80be77dd8ad71b57;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/populateRecentChangesSource.php b/maintenance/populateRecentChangesSource.php index eb9797f0b0..8a56d7d875 100644 --- a/maintenance/populateRecentChangesSource.php +++ b/maintenance/populateRecentChangesSource.php @@ -46,13 +46,13 @@ class PopulateRecentChangesSource extends LoggedUpdateMaintenance { $this->error( 'rc_source field in recentchanges table does not exist.' ); } - $start = $dbw->selectField( 'recentchanges', 'MIN(rc_id)', false, __METHOD__ ); + $start = $dbw->selectField( 'recentchanges', 'MIN(rc_id)', '', __METHOD__ ); if ( !$start ) { $this->output( "Nothing to do.\n" ); return true; } - $end = $dbw->selectField( 'recentchanges', 'MAX(rc_id)', false, __METHOD__ ); + $end = $dbw->selectField( 'recentchanges', 'MAX(rc_id)', '', __METHOD__ ); $end += $batchSize - 1; $blockStart = $start; $blockEnd = $start + $batchSize - 1; @@ -60,14 +60,12 @@ class PopulateRecentChangesSource extends LoggedUpdateMaintenance { $updatedValues = $this->buildUpdateCondition( $dbw ); while ( $blockEnd <= $end ) { - $cond = "rc_id BETWEEN $blockStart AND $blockEnd"; - $dbw->update( 'recentchanges', [ $updatedValues ], [ "rc_source = ''", - "rc_id BETWEEN $blockStart AND $blockEnd" + "rc_id BETWEEN " . (int)$blockStart . " AND " . (int)$blockEnd ], __METHOD__ ); @@ -106,5 +104,5 @@ class PopulateRecentChangesSource extends LoggedUpdateMaintenance { } } -$maintClass = "PopulateRecentChangesSource"; +$maintClass = PopulateRecentChangesSource::class; require_once RUN_MAINTENANCE_IF_MAIN;