class ResetUserTokens extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription =
- "Reset the user_token of all users on the wiki. Note that this may log some of them out.";
+ $this->addDescription(
+ 'Reset the user_token of all users on the wiki. Note that this may log some of them out.'
+ );
$this->addOption( 'nowarn', "Hides the 5 seconds warning", false, false );
$this->addOption(
'nulls',
}
// We list user by user_id from one of the slave database
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = $this->getDB( DB_SLAVE );
$where = array();
if ( $this->nullsOnly ) {
// Have to build this by hand, because \ is escaped in helper functions
- $where = array( 'user_token = \'' . str_repeat( '\0', 32) . '\'' );
+ $where = array( 'user_token = \'' . str_repeat( '\0', 32 ) . '\'' );
}
$maxid = $dbr->selectField( 'user', 'MAX(user_id)', array(), __METHOD__ );
$max = $min + $this->mBatchSize;
wfWaitForSlaves();
-
} while ( $min <= $maxid );
-
}
private function updateUser( $userid ) {