27require_once __DIR__ .
'/Maintenance.php';
41 parent::__construct();
42 $this->
addDescription(
'Verify that database usernames are actually valid' );
52 $res = $dbr->newSelectQueryBuilder()
53 ->select( [
'user_id',
'user_name' ] )
55 ->where( $dbr->expr(
'user_id',
'>', $maxUserId ) )
56 ->orderBy(
'user_id' )
58 ->caller( __METHOD__ )
61 foreach ( $res as $row ) {
62 if ( !$userNameUtils->isValid( $row->user_name ) ) {
63 $this->
output( sprintf(
"Found: %6d: '%s'\n", $row->user_id, $row->user_name ) );
64 wfDebugLog(
'checkUsernames', $row->user_name );
68 $maxUserId = $row->user_id;
69 }
while ( $res->numRows() );
75require_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.
getServiceContainer()
Returns the main service container.
addDescription( $text)
Set the description text.