X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FupdateDoubleWidthSearch.php;h=d28ae271f9b1b89300a9428bb11b8f2d05d41652;hb=efbfa0a727a196e63a2b71f0a82f09150c2be354;hp=796cedd98d302e9afa3445bf526317978f4c8914;hpb=19a38526f390cfdc6a6061cc055fc7f13167bf03;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/updateDoubleWidthSearch.php b/maintenance/updateDoubleWidthSearch.php index 796cedd98d..d28ae271f9 100644 --- a/maintenance/updateDoubleWidthSearch.php +++ b/maintenance/updateDoubleWidthSearch.php @@ -1,6 +1,6 @@ mDescription = "Script to normalize double-byte latin UTF-8 characters"; + $this->addDescription( 'Script to normalize double-byte Latin UTF-8 characters' ); $this->addOption( 'q', 'quiet', false, true ); $this->addOption( 'l', @@ -51,13 +51,13 @@ class UpdateDoubleWidthSearch extends Maintenance { public function execute() { $maxLockTime = $this->getOption( 'l', 20 ); - $dbw = wfGetDB( DB_MASTER ); + $dbw = $this->getDB( DB_MASTER ); if ( $dbw->getType() !== 'mysql' ) { - $this->error( "This change is only needed on MySQL, quitting.\n", true ); + $this->fatalError( "This change is only needed on MySQL, quitting.\n" ); } $res = $this->findRows( $dbw ); - $this->updateSearchIndex( $maxLockTime, array( $this, 'searchIndexUpdateCallback' ), $dbw, $res ); + $this->updateSearchIndex( $maxLockTime, [ $this, 'searchIndexUpdateCallback' ], $dbw, $res ); $this->output( "Done\n" ); } @@ -77,5 +77,5 @@ class UpdateDoubleWidthSearch extends Maintenance { } } -$maintClass = "UpdateDoubleWidthSearch"; +$maintClass = UpdateDoubleWidthSearch::class; require_once RUN_MAINTENANCE_IF_MAIN;