Conditions | 6 |
Paths | 2 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
9 | public function invalidatePageAction() { |
||
10 | $response = array( |
||
11 | 'success' => false |
||
12 | ); |
||
13 | $pageId = (int) $this->params()->fromRoute('page_id'); |
||
14 | $pagesDir = $this->getPagesPath(); |
||
15 | if($pageId > 0 && is_dir($pagesDir)) { |
||
16 | $dirContent = scandir($pagesDir); |
||
17 | foreach($dirContent as $languageDir) { |
||
18 | $filename = $pagesDir.$languageDir.'/'.$pageId.'.html'; |
||
19 | if(file_exists($filename) && is_file($filename)){ |
||
20 | unlink($filename); |
||
21 | } |
||
22 | } |
||
23 | $response['success'] = true; |
||
24 | } |
||
25 | return $response; |
||
26 | } |
||
27 | |||
38 |