Skip to content

Commit

Permalink
httpcache:clear command changed to only delete the underlying directo…
Browse files Browse the repository at this point in the history
…ries in the httpcache storage folder (#44)
  • Loading branch information
roennow authored and barryvdh committed Sep 1, 2017
1 parent e70c4e3 commit ff053f8
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/Console/ClearCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,19 @@ public function __construct(Filesystem $files)
*/
public function handle()
{

$cacheDir = $this->laravel['http_cache.cache_dir'];

if($this->files->cleanDirectory($cacheDir)){
$this->info('HttpCache cleared!');
}else{
$this->error('Could not clear HttpCache');
foreach ($this->files->glob("{$cacheDir}/*") as $directory) {
if (!$this->files->deleteDirectory($directory)) {
$errors = true;
}
}

if (isset($errors)) {
$this->error('Could not clear HttpCache');
} else {
$this->info('HttpCache cleared!');
}
}


Expand Down

0 comments on commit ff053f8

Please sign in to comment.