Conditions | 5 |
Paths | 8 |
Total Lines | 19 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | public function run($request) |
||
24 | { |
||
25 | $this->dryRun = $request->getVar('forreal') ? false : true; |
||
26 | $this->dryRunMessage(); |
||
27 | $files = AllFilesInfo::inst()->getAllFiles(); |
||
28 | foreach ($files as $file) { |
||
29 | $array = $file->toMap(); |
||
30 | if (!empty($array['ErrorDBNotPresent'])) { |
||
31 | DB::alteration_message('--- Deleting from DB' . $array['Path'], 'deleted'); |
||
32 | try { |
||
33 | unlink($array['AbsolutePath']); |
||
34 | } catch (Exception $e) { |
||
35 | DB::alteration_message('Error: ' . $e->getMessage(), 'deleted'); |
||
36 | } |
||
37 | } |
||
38 | } |
||
39 | |||
40 | $this->dryRunMessage(); |
||
41 | DB::alteration_message('=== DONE ===', ''); |
||
42 | } |
||
53 |