} elseif ( $inputAge !== null ) {
$date = wfTimestamp( TS_MW, time() + $wgParserCacheExpireTime - intval( $inputAge ) );
} else {
- $this->error( "Must specify either --expiredate or --age", 1 );
+ $this->fatalError( "Must specify either --expiredate or --age" );
return;
}
$this->usleep = 1e3 * $this->getOption( 'msleep', 0 );
$pc = MediaWikiServices::getInstance()->getParserCache()->getCacheStorage();
$success = $pc->deleteObjectsExpiringBefore( $date, [ $this, 'showProgressAndWait' ] );
if ( !$success ) {
- $this->error( "\nCannot purge this kind of parser cache.", 1 );
+ $this->fatalError( "\nCannot purge this kind of parser cache." );
}
$this->showProgressAndWait( 100 );
$this->output( "\nDone\n" );
}
}
-$maintClass = 'PurgeParserCache';
+$maintClass = PurgeParserCache::class;
require_once RUN_MAINTENANCE_IF_MAIN;