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

ClearCacheTask   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 28
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A main() 0 6 1
A getOptionParser() 0 8 1
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