Merge "Update Microsoft SQL Server schema"
[lhc/web/wiklou.git] / maintenance / populateRecentChangesSource.php
index 0e8e501..05098ac 100644 (file)
@@ -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__
                        );