X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FpruneFileCache.php;h=8e6978d5626eadb50f5b2ee431040669782c17de;hb=f5b9af121a07ecc674a63cbc65c3a01e9fa7d785;hp=e058e3ec36e13c9a741f008abc4bdb78cf94df29;hpb=67e23ec357d2265bc487bdd4b63e30fcaf5871c7;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/pruneFileCache.php b/maintenance/pruneFileCache.php index e058e3ec36..8e6978d562 100644 --- a/maintenance/pruneFileCache.php +++ b/maintenance/pruneFileCache.php @@ -21,7 +21,7 @@ * @ingroup Maintenance */ -require_once( __DIR__ . '/Maintenance.php' ); +require_once __DIR__ . '/Maintenance.php'; /** * Maintenance script that prunes file cache for pages, objects, resources, etc. @@ -34,7 +34,7 @@ class PruneFileCache extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = "Build file cache for content pages"; + $this->addDescription( 'Build file cache for content pages' ); $this->addOption( 'agedays', 'How many days old files must be in order to delete', true, true ); $this->addOption( 'subdir', 'Prune one $wgFileCacheDirectory subdirectory name', false, true ); } @@ -75,8 +75,8 @@ class PruneFileCache extends Maintenance { } /** - * @param $dir string - * @param $report string|bool Use 'report' to report the directories being scanned + * @param string $dir + * @param string|bool $report Use 'report' to report the directories being scanned */ protected function prune_directory( $dir, $report = false ) { $tsNow = time(); @@ -95,8 +95,8 @@ class PruneFileCache extends Maintenance { // Sanity check the file extension against known cache types if ( $mts < $this->minSurviveTimestamp && preg_match( '/\.(?:html|cache)(?:\.gz)?$/', $file ) - && unlink( $path ) ) - { + && unlink( $path ) + ) { $daysOld = round( ( $tsNow - $mts ) / 86400, 2 ); $this->output( "Deleted `$path` [days=$daysOld]\n" ); } @@ -108,4 +108,4 @@ class PruneFileCache extends Maintenance { } $maintClass = "PruneFileCache"; -require_once( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN;