Conditions | 5 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | public function actionIndex(): void |
||
12 | { |
||
13 | Cli::printer("Enter cache type (empty for all): ", "magneta"); |
||
14 | $type = str_replace(PHP_EOL, "", Cli::reader()); |
||
15 | |||
16 | $folderPath = !empty($type) |
||
17 | ? dirname(__DIR__, 2) . "/cache/$type" |
||
18 | : dirname(__DIR__, 2) . "/cache"; |
||
19 | |||
20 | if ($this->deleteDirectory($folderPath)) { |
||
21 | Cli::printer(!empty($type) |
||
22 | ? "Cache $type was cleared" . PHP_EOL |
||
23 | : "Cache was cleared" . PHP_EOL, "light_green"); |
||
24 | } else { |
||
25 | Cli::printer(!empty($type) |
||
26 | ? "Cache type '$type' does not exist." . PHP_EOL |
||
27 | : "Cache directory does not exist." . PHP_EOL, "red"); |
||
28 | } |
||
48 |