addDescription( 'Script to update single TOTP keys to multi-key environment' ); $this->requireExtension( 'OATHAuth' ); } public function execute() { global $wgOATHAuthDatabase; $lb = MediaWikiServices::getInstance()->getDBLoadBalancerFactory() ->getMainLB( $wgOATHAuthDatabase ); $dbw = $lb->getConnectionRef( DB_PRIMARY, [], $wgOATHAuthDatabase ); if ( !UpdateTables::switchTOTPToMultipleKeys( $dbw ) ) { $this->fatalError( "Failed to update TOTP keys.\n" ); } $this->output( "Done.\n" ); } } $maintClass = UpdateTOTPToMultipleKeys::class; require_once RUN_MAINTENANCE_IF_MAIN;