X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FfixUserRegistration.php;h=37fd44fb2e11eb6bc17c8a84499547026090b438;hb=f43fa6f4f0e2cb60b8543daad661b48a3e0653a9;hp=d09760b4bd115cd67a016bffdf4dfd6daec956d9;hpb=f875f3d31867067116641af987dea4511324e96b;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/fixUserRegistration.php b/maintenance/fixUserRegistration.php index d09760b4bd..37fd44fb2e 100644 --- a/maintenance/fixUserRegistration.php +++ b/maintenance/fixUserRegistration.php @@ -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 );