$this->addDescription( "Remove old objects from the parser cache. " .
"This only works when the parser cache is in an SQL database." );
$this->addOption( 'expiredate', 'Delete objects expiring before this date.', false, true );
- $this->addOption( 'age',
+ $this->addOption(
+ 'age',
'Delete objects created more than this many seconds ago, assuming $wgParserCacheExpireTime ' .
'has been consistent.',
false, true );
$this->output( "Deleting objects expiring before " . $english->timeanddate( $date ) . "\n" );
$pc = wfGetParserCacheStorage();
- $success = $pc->deleteObjectsExpiringBefore( $date, array( $this, 'showProgress' ) );
+ $success = $pc->deleteObjectsExpiringBefore( $date, [ $this, 'showProgress' ] );
if ( !$success ) {
$this->error( "\nCannot purge this kind of parser cache.", 1 );
}
$stars = floor( $percent / 2 );
$this->output( '[' . str_repeat( '*', $stars ) . str_repeat( '.', 50 - $stars ) . '] ' .
"$percentString%\r" );
-
}
}
+
$maintClass = 'PurgeParserCache';
require_once RUN_MAINTENANCE_IF_MAIN;