Yet another attempt to fix the populateIpChanges script
[lhc/web/wiklou.git] / maintenance / fixUserRegistration.php
index d09760b..37fd44f 100644 (file)
@@ -32,7 +32,7 @@ require_once __DIR__ . '/Maintenance.php';
 class FixUserRegistration extends Maintenance {
        public function __construct() {
                parent::__construct();
-               $this->mDescription = "Fix the user_registration field";
+               $this->addDescription( 'Fix the user_registration field' );
                $this->setBatchSize( 1000 );
        }
 
@@ -45,15 +45,15 @@ class FixUserRegistration extends Maintenance {
                        $res = $dbw->select(
                                'user',
                                'user_id',
-                               array(
+                               [
                                        'user_id > ' . $dbw->addQuotes( $lastId ),
                                        'user_registration IS NULL'
-                               ),
+                               ],
                                __METHOD__,
-                               array(
+                               [
                                        'LIMIT' => $this->mBatchSize,
                                        'ORDER BY' => 'user_id',
-                               )
+                               ]
                        );
                        foreach ( $res as $row ) {
                                $id = $row->user_id;
@@ -62,15 +62,15 @@ class FixUserRegistration extends Maintenance {
                                $timestamp = $dbw->selectField(
                                        'revision',
                                        'MIN(rev_timestamp)',
-                                       array( 'rev_user' => $id ),
+                                       [ 'rev_user' => $id ],
                                        __METHOD__
                                );
                                // Update
                                if ( $timestamp !== null ) {
                                        $dbw->update(
                                                'user',
-                                               array( 'user_registration' => $timestamp ),
-                                               array( 'user_id' => $id ),
+                                               [ 'user_registration' => $timestamp ],
+                                               [ 'user_id' => $id ],
                                                __METHOD__
                                        );
                                        $user = User::newFromId( $id );
@@ -80,7 +80,7 @@ class FixUserRegistration extends Maintenance {
                                        $this->output( "Could not find registration for #$id NULL\n" );
                                }
                        }
-                       $this->output( "Waiting for slaves..." );
+                       $this->output( "Waiting for replica DBs..." );
                        wfWaitForSlaves();
                        $this->output( " done.\n" );
                } while ( $res->numRows() >= $this->mBatchSize );