X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22statistiques_visites%22%2C%22%22%29%20.%20%22?a=blobdiff_plain;f=maintenance%2FcheckUsernames.php;h=6c1343aad1451c08b480f1882d2270471af7c094;hb=a607607a1851b8de317959cbde054e96181e875c;hp=6f4d1704576c0376479fe32f0438311c0044c6c0;hpb=f875f3d31867067116641af987dea4511324e96b;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/checkUsernames.php b/maintenance/checkUsernames.php index 6f4d170457..6c1343aad1 100644 --- a/maintenance/checkUsernames.php +++ b/maintenance/checkUsernames.php @@ -35,23 +35,23 @@ class CheckUsernames extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = "Verify that database usernames are actually valid"; + $this->addDescription( 'Verify that database usernames are actually valid' ); $this->setBatchSize( 1000 ); } function execute() { - $dbr = $this->getDB( DB_SLAVE ); + $dbr = $this->getDB( DB_REPLICA ); $maxUserId = 0; do { $res = $dbr->select( 'user', - array( 'user_id', 'user_name' ), - array( 'user_id > ' . $maxUserId ), + [ 'user_id', 'user_name' ], + [ 'user_id > ' . $maxUserId ], __METHOD__, - array( + [ 'ORDER BY' => 'user_id', - 'LIMIT' => $this->mBatchSize, - ) + 'LIMIT' => $this->getBatchSize(), + ] ); foreach ( $res as $row ) { @@ -65,5 +65,5 @@ class CheckUsernames extends Maintenance { } } -$maintClass = "CheckUsernames"; +$maintClass = CheckUsernames::class; require_once RUN_MAINTENANCE_IF_MAIN;