| Conditions | 7 |
| Paths | 16 |
| Total Lines | 28 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public function cmdClearCache() |
||
| 40 | { |
||
| 41 | $id = $this->getParam(0); |
||
| 42 | $all = $this->getParam('all'); |
||
| 43 | |||
| 44 | if (!isset($id) && empty($all)) { |
||
| 45 | $this->errorExit($this->text('Invalid command')); |
||
| 46 | } |
||
| 47 | |||
| 48 | $result = false; |
||
| 49 | |||
| 50 | if (isset($id)) { |
||
| 51 | $pattern = $this->getParam('pattern'); |
||
| 52 | if (isset($pattern)) { |
||
| 53 | $result = $this->cache->clear($id, array('pattern' => $pattern)); |
||
| 54 | } else { |
||
| 55 | $result = $this->cache->clear($id); |
||
| 56 | } |
||
| 57 | } else if ($all) { |
||
| 58 | $result = $this->cache->clear(null); |
||
| 59 | } |
||
| 60 | |||
| 61 | if (!$result) { |
||
| 62 | $this->errorExit($this->text('An error occurred')); |
||
| 63 | } |
||
| 64 | |||
| 65 | $this->output(); |
||
| 66 | } |
||
| 67 | |||
| 69 |