X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2FpopulateRecentChangesSource.php;h=05098ac0a9ca6bc7f0cb8a139b0b93f535d5d36e;hb=5f79d3c992d82ff0d7644a1c7decd7bec70f38b7;hp=0e8e50125276480f17b2ec2a014a403716ecc34e;hpb=d4eefca4dd645bbef2b435ef1228a141f6a48e67;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/populateRecentChangesSource.php b/maintenance/populateRecentChangesSource.php index 0e8e501252..05098ac0a9 100644 --- a/maintenance/populateRecentChangesSource.php +++ b/maintenance/populateRecentChangesSource.php @@ -21,7 +21,7 @@ * @ingroup Maintenance */ -require_once dirname( __FILE__ ) . '/Maintenance.php'; +require_once __DIR__ . '/Maintenance.php'; /** * Maintenance script to populate the rc_source field. @@ -32,7 +32,8 @@ require_once dirname( __FILE__ ) . '/Maintenance.php'; class PopulateRecentChangesSource extends LoggedUpdateMaintenance { public function __construct() { parent::__construct(); - $this->mDescription = "Populates rc_source field of the recentchanges table with the data in rc_type."; + $this->addDescription( + 'Populates rc_source field of the recentchanges table with the data in rc_type.' ); $this->setBatchSize( 100 ); } @@ -45,6 +46,7 @@ class PopulateRecentChangesSource extends LoggedUpdateMaintenance { $start = $dbw->selectField( 'recentchanges', 'MIN(rc_id)', false, __METHOD__ ); if ( !$start ) { $this->output( "Nothing to do.\n" ); + return true; } $end = $dbw->selectField( 'recentchanges', 'MAX(rc_id)', false, __METHOD__ ); @@ -59,11 +61,11 @@ class PopulateRecentChangesSource extends LoggedUpdateMaintenance { $dbw->update( 'recentchanges', - array( $updatedValues ), - array( + [ $updatedValues ], + [ "rc_source = ''", "rc_id BETWEEN $blockStart AND $blockEnd" - ), + ], __METHOD__ );