Conditions | 6 |
Paths | 4 |
Total Lines | 20 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
31 | public function cmdCacheClearAsset() |
||
32 | { |
||
33 | $type = $this->getParam(0); |
||
34 | |||
35 | if (empty($type)) { |
||
36 | foreach (new DirectoryIterator(GC_DIR_ASSET_COMPILED) as $file) { |
||
37 | if ($file->isDir() && !$file->isDot()) { |
||
38 | gplcart_file_delete_recursive($file->getRealPath()); |
||
39 | } |
||
40 | } |
||
41 | } else { |
||
42 | $file = GC_DIR_ASSET_COMPILED . "/$type"; |
||
43 | if (!is_dir($file)) { |
||
44 | $this->errorAndExit($this->text('Invalid command')); |
||
45 | } |
||
46 | gplcart_file_delete_recursive($file); |
||
47 | } |
||
48 | |||
49 | $this->output(); |
||
50 | } |
||
51 | |||
53 |