X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FpurgeParserCache.php;h=5d085a8b690e5799c23e7e775b6bdc2ec6b0051e;hb=df2ef5194e88514081511302da45ebf19afcb248;hp=9b92b323543bac5d11ab1aa0f2bc1b29c17ea628;hpb=f3de84430d8e569d9de9302f1855139edb28df03;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/purgeParserCache.php b/maintenance/purgeParserCache.php index 9b92b32354..5d085a8b69 100644 --- a/maintenance/purgeParserCache.php +++ b/maintenance/purgeParserCache.php @@ -22,7 +22,7 @@ * @ingroup Maintenance */ -require( __DIR__ . '/Maintenance.php' ); +require __DIR__ . '/Maintenance.php'; /** * Maintenance script to remove old objects from the parser cache. @@ -37,7 +37,8 @@ class PurgeParserCache extends Maintenance { $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 ); @@ -59,7 +60,7 @@ class PurgeParserCache extends Maintenance { $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 ); } @@ -77,8 +78,8 @@ class PurgeParserCache extends Maintenance { $stars = floor( $percent / 2 ); $this->output( '[' . str_repeat( '*', $stars ) . str_repeat( '.', 50 - $stars ) . '] ' . "$percentString%\r" ); - } } + $maintClass = 'PurgeParserCache'; require_once RUN_MAINTENANCE_IF_MAIN;