1 | <?php |
||
2 | |||
3 | /** |
||
4 | * @license MIT, http://opensource.org/licenses/MIT |
||
5 | * @copyright Aimeos (aimeos.org), 2015-2023 |
||
6 | */ |
||
7 | |||
8 | |||
9 | namespace Aimeos\Shop\Command; |
||
10 | |||
11 | |||
12 | /** |
||
13 | * Command for clearing the content cache |
||
14 | */ |
||
15 | class ClearCommand extends AbstractCommand |
||
16 | { |
||
17 | /** |
||
18 | * The name and signature of the console command. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $signature = 'aimeos:clear'; |
||
23 | |||
24 | /** |
||
25 | * The console command description. |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $description = 'Clears the content cache'; |
||
30 | |||
31 | |||
32 | /** |
||
33 | * Execute the console command. |
||
34 | * |
||
35 | * @return mixed |
||
36 | */ |
||
37 | public function handle() |
||
38 | { |
||
39 | $this->info( 'Clearing Aimeos cache', 'v' ); |
||
40 | |||
41 | $context = $this->getLaravel()->make( 'aimeos.context' )->get( false, 'command' ); |
||
42 | $context->setEditor( 'aimeos:clear' ); |
||
43 | |||
44 | \Aimeos\MAdmin::create( $context, 'cache' )->getCache()->clear(); |
||
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
45 | } |
||
46 | } |
||
47 |