X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FresetUserTokens.php;h=710198b870d1cd668566a5efe35e540817988428;hb=fa0f6f34972c0e0f4aac24a03b3efdfc45f256f6;hp=1c8b4b9d0bcc6d12879cef85e802bba63cc35edf;hpb=433d2480f994932162da94b857e1d297d59cd4c8;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/resetUserTokens.php b/maintenance/resetUserTokens.php index 1c8b4b9d0b..154482c75a 100644 --- a/maintenance/resetUserTokens.php +++ b/maintenance/resetUserTokens.php @@ -50,10 +50,10 @@ class ResetUserTokens extends Maintenance { } public function execute() { - $this->nullsOnly = $this->getOption( 'nulls' ); + $nullsOnly = $this->getOption( 'nulls' ); if ( !$this->getOption( 'nowarn' ) ) { - if ( $this->nullsOnly ) { + if ( $nullsOnly ) { $this->output( "The script is about to reset the user_token " . "for USERS WITH NULL TOKENS in the database.\n" ); } else { @@ -68,11 +68,10 @@ class ResetUserTokens extends Maintenance { } // We list user by user_id from one of the replica DBs - // We list user by user_id from one of the slave database $dbr = $this->getDB( DB_REPLICA ); $where = []; - if ( $this->nullsOnly ) { + if ( $nullsOnly ) { // Have to build this by hand, because \ is escaped in helper functions $where = [ 'user_token = \'' . str_repeat( '\0', 32 ) . '\'' ]; } @@ -80,7 +79,7 @@ class ResetUserTokens extends Maintenance { $maxid = $dbr->selectField( 'user', 'MAX(user_id)', [], __METHOD__ ); $min = 0; - $max = $this->mBatchSize; + $max = $this->getBatchSize(); do { $result = $dbr->select( 'user', @@ -99,7 +98,7 @@ class ResetUserTokens extends Maintenance { } $min = $max; - $max = $min + $this->mBatchSize; + $max = $min + $this->getBatchSize(); wfWaitForSlaves(); } while ( $min <= $maxid ); @@ -116,5 +115,5 @@ class ResetUserTokens extends Maintenance { } } -$maintClass = "ResetUserTokens"; +$maintClass = ResetUserTokens::class; require_once RUN_MAINTENANCE_IF_MAIN;