31require_once __DIR__ .
'/Maintenance.php';
47 parent::__construct();
48 $this->
addDescription(
'Populates the user_is_temp field of the user table.' );
61 if ( !$this->tempUserConfig->isKnown() ) {
68 $queryBuilder = $this->dbr->newSelectQueryBuilder()
73 $this->tempUserConfig->getMatchCondition( $this->dbr,
'user_name', IExpression::LIKE ),
76 ->caller( __METHOD__ );
80 $batch = $queryBuilder->fetchFieldValues();
81 if ( count( $batch ) ) {
83 $this->dbw->newUpdateQueryBuilder()
85 ->set( [
'user_is_temp' => 1 ] )
86 ->where( [
'user_id' => $batch ] )
87 ->caller( __METHOD__ )
90 }
while ( count( $batch ) >= ( $this->
getBatchSize() ?? 200 ) );
110require_once RUN_MAINTENANCE_IF_MAIN;
Class for scripts that perform database maintenance and want to log the update in updatelog so we can...
getBatchSize()
Returns batch size.
getDB( $db, $groups=[], $dbDomain=false)
Returns a database to be used by current maintenance script.
getServiceContainer()
Returns the main service container.
addDescription( $text)
Set the description text.
Maintenance script that Fills the user_is_temp column of the user table for users created before MW 1...
__construct()
Default constructor.
initServices()
Initialise the services and database connections used by this script.
getUpdateKey()
Get the update key name to go in the update log table.string
doDBUpdates()
Do the actual work.All child classes will need to implement this. Return true to log the update as do...