X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrecountCategories.php;h=7e8f0636d5ebc00a58d423c71e1b92ea2ac9f8f2;hb=449e31a179e337edbc205262bb29476c901d19c5;hp=a4bfa989921d70b0cd356a2e03414002c8b94def;hpb=732b5e2745ca8f6153e19cc10c3c9acb1b2a6331;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/recountCategories.php b/maintenance/recountCategories.php index a4bfa98992..7e8f0636d5 100644 --- a/maintenance/recountCategories.php +++ b/maintenance/recountCategories.php @@ -75,7 +75,7 @@ TEXT public function execute() { $this->mode = $this->getOption( 'mode' ); if ( !in_array( $this->mode, [ 'pages', 'subcats', 'files' ] ) ) { - $this->error( 'Please specify a valid mode: one of "pages", "subcats" or "files".', 1 ); + $this->fatalError( 'Please specify a valid mode: one of "pages", "subcats" or "files".' ); } $this->minimumId = intval( $this->getOption( 'begin', 0 ) ); @@ -97,8 +97,8 @@ TEXT } protected function doWork() { - $this->output( "Finding up to {$this->mBatchSize} drifted rows " . - "starting at cat_id {$this->minimumId}...\n" ); + $this->output( "Finding up to {$this->getBatchSize()} drifted rows " . + "starting at cat_id {$this->getBatchSize()}...\n" ); $countingConds = [ 'cl_to = cat_title' ]; if ( $this->mode === 'subcats' ) { @@ -124,7 +124,7 @@ TEXT "cat_{$this->mode} != ($countingSubquery)" ], __METHOD__, - [ 'LIMIT' => $this->mBatchSize ] + [ 'LIMIT' => $this->getBatchSize() ] ); if ( !$idsToUpdate ) { return false; @@ -156,7 +156,7 @@ TEXT [ "cat_{$this->mode}" => $row->count ], [ 'cat_id' => $row->cat_id, - "cat_{$this->mode} != {$row->count}", + "cat_{$this->mode} != " . (int)( $row->count ), ], __METHOD__ ); $affectedRows += $dbw->affectedRows(); @@ -168,5 +168,5 @@ TEXT } } -$maintClass = 'RecountCategories'; +$maintClass = RecountCategories::class; require_once RUN_MAINTENANCE_IF_MAIN;