Add rcc command
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
eee6b86e15
commit
9f787646c4
|
@ -4,6 +4,7 @@ namespace Aweos\Resizer;
|
|||
|
||||
use Aweos\Resizer\Classes\CacheManager;
|
||||
use Aweos\Resizer\Classes\ImageResizer;
|
||||
use Aweos\Resizer\Console\ResizeCacheClear;
|
||||
use Aweos\Resizer\Console\ResizeMake;
|
||||
use Aweos\Resizer\Console\ResizePurge;
|
||||
use Aweos\Resizer\Jobs\DeleteJob;
|
||||
|
@ -47,6 +48,7 @@ class Plugin extends PluginBase
|
|||
{
|
||||
$this->registerConsoleCommand('resizer.resizemake', ResizeMake::class);
|
||||
$this->registerConsoleCommand('resizer.resizepurge', ResizePurge::class);
|
||||
$this->registerConsoleCommand('resizer.resize-cache-clear', ResizeCacheClear::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -56,5 +56,4 @@ class CacheManager
|
|||
|
||||
return $this->tagGenerator->singleFile($path, $size);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
namespace Aweos\Resizer\Console;
|
||||
|
||||
use Aweos\Resizer\Classes\CacheManager;
|
||||
use Aweos\Resizer\Lib\StorageMediaPath;
|
||||
use Illuminate\Console\Command;
|
||||
use Storage;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
|
||||
class ResizeCacheClear extends Command
|
||||
{
|
||||
/**
|
||||
* @var string The console command name.
|
||||
*/
|
||||
protected $name = 'rcc';
|
||||
|
||||
/**
|
||||
* @var string The console command description.
|
||||
*/
|
||||
protected $description = 'Clears cache for a specific file';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$path = new StorageMediaPath($this->argument('path'));
|
||||
app(CacheManager::class)->delete($path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the console command arguments.
|
||||
* @return array
|
||||
*/
|
||||
protected function getArguments()
|
||||
{
|
||||
return [
|
||||
['path', InputArgument::REQUIRED, 'The path on the storage'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the console command options.
|
||||
* @return array
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue