Completed
Push — master ( d012cb...0f7aa6 )
by Fèvre
05:35
created

ClearCacheTask::main()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
namespace App\Shell\Task;
3
4
use Cake\Cache\Cache;
5
use Cake\Console\ConsoleOptionParser;
6
use Cake\Console\Shell;
7
8
class ClearCacheTask extends Shell
9
{
10
    /**
11
     * Execute the ClearCache task.
12
     *
13
     * @return void
14
     */
15
    public function main()
16
    {
17
        Cache::clear(false, '_cake_core_');
18
        Cache::clear(false, 'acl');
19
        $this->out('<info>The</info> "<error>deployer clear_cache</error>" <info>command has been executed successfully !</info>', 2);
20
    }
21
22
    /**
23
     * Display help for this console.
24
     *
25
     * @return ConsoleOptionParser
26
     */
27
    public function getOptionParser()
28
    {
29
        $parser = new ConsoleOptionParser('clear_cache', false);
30
        $parser->description(
31
            'This tasks is used to clear the cached files in the application.'
32
        );
33
        return $parser;
34
    }
35
}
36