X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FpruneFileCache.php;h=1035ff512f710c2550ab415f542f40547ef48308;hb=d1000765e7ee710bf892e3772afdabfb5f6b1f6c;hp=01bd09a244419587012bfe45285735211ff80df7;hpb=e0d92d376b3c326c2a3c25b2956f1b53939007af;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/pruneFileCache.php b/maintenance/pruneFileCache.php index 01bd09a244..1035ff512f 100644 --- a/maintenance/pruneFileCache.php +++ b/maintenance/pruneFileCache.php @@ -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 ); } @@ -43,25 +43,25 @@ class PruneFileCache extends Maintenance { global $wgUseFileCache, $wgFileCacheDirectory; if ( !$wgUseFileCache ) { - $this->error( "Nothing to do -- \$wgUseFileCache is disabled.", true ); + $this->fatalError( "Nothing to do -- \$wgUseFileCache is disabled." ); } $age = $this->getOption( 'agedays' ); if ( !ctype_digit( $age ) ) { - $this->error( "Non-integer 'age' parameter given.", true ); + $this->fatalError( "Non-integer 'age' parameter given." ); } // Delete items with a TS older than this $this->minSurviveTimestamp = time() - ( 86400 * $age ); $dir = $wgFileCacheDirectory; if ( !is_dir( $dir ) ) { - $this->error( "Nothing to do -- \$wgFileCacheDirectory directory not found.", true ); + $this->fatalError( "Nothing to do -- \$wgFileCacheDirectory directory not found." ); } $subDir = $this->getOption( 'subdir' ); if ( $subDir !== null ) { if ( !is_dir( "$dir/$subDir" ) ) { - $this->error( "The specified subdirectory `$subDir` does not exist.", true ); + $this->fatalError( "The specified subdirectory `$subDir` does not exist." ); } $this->output( "Pruning `$dir/$subDir` directory...\n" ); $this->prune_directory( "$dir/$subDir", 'report' ); @@ -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();