13require_once __DIR__ .
'/Maintenance.php';
27 parent::__construct();
28 $this->
addDescription(
'Verify that database usernames are actually valid' );
38 $res = $dbr->newSelectQueryBuilder()
39 ->select( [
'user_id',
'user_name' ] )
41 ->where( $dbr->expr(
'user_id',
'>', $maxUserId ) )
42 ->orderBy(
'user_id' )
44 ->caller( __METHOD__ )
47 foreach ( $res as $row ) {
48 if ( !$userNameUtils->isValid( $row->user_name ) ) {
49 $this->
output( sprintf(
"Found: %6d: '%s'\n", $row->user_id, $row->user_name ) );
50 wfDebugLog(
'checkUsernames', $row->user_name );
54 $maxUserId = $row->user_id;
55 }
while ( $res->numRows() );
61require_once RUN_MAINTENANCE_IF_MAIN;
wfDebugLog( $logGroup, $text, $dest='all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not.
Maintenance script to check that database usernames are actually valid.
__construct()
Default constructor.
execute()
Do the actual work.
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
getBatchSize()
Returns batch size.
output( $out, $channel=null)
Throw some output to the user.
getReplicaDB(string|false $virtualDomain=false)
getServiceContainer()
Returns the main service container.
addDescription( $text)
Set the description text.