addDescription( 'Script to update TOTP Scratch Tokens to an array' ); $this->requireExtension( 'OATHAuth' ); } public function execute() { global $wgOATHAuthDatabase; $lb = MediaWikiServices::getInstance()->getDBLoadBalancerFactory() ->getMainLB( $wgOATHAuthDatabase ); $dbw = $lb->getConnectionRef( DB_PRIMARY, [], $wgOATHAuthDatabase ); if ( !UpdateTables::switchTOTPScratchTokensToArray( $dbw ) ) { $this->fatalError( "Failed to update TOTP Scratch Tokens.\n" ); } $this->output( "Done.\n" ); } } $maintClass = UpdateTOTPScratchTokensToArray::class; require_once RUN_MAINTENANCE_IF_MAIN;