Modifs cache

This commit is contained in:
2017-10-11 17:20:42 +02:00
parent ed9f373f4f
commit a1dea266c8
4 changed files with 48 additions and 53 deletions

View File

@@ -4,6 +4,7 @@ namespace Meoran\Images\Console\Commands;
use FilesystemIterator;
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
@@ -39,8 +40,13 @@ class CacheGarbageCollectorCommand extends Command
*/
public function handle()
{
$path = storage_path('image.path');
$files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS));
$base = config('image.cache.path');
if (empty($base)) {
$this->line("Le cache n'est pas configuré. End...");
return;
}
$fs = new Filesystem();
$files = collect($fs->allFiles($base));
/**
* @var \SplFileInfo $b