Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public function run($request) |
||
17 | { |
||
18 | $path = sprintf('%s/%s', BASE_PATH, BasePage::config()->get('generated_pdf_path')); |
||
19 | if (!file_exists($path)) { |
||
20 | return false; |
||
21 | } |
||
22 | |||
23 | exec(sprintf('if [ "$(ls -A %s 2> /dev/null)" != "" ]; then rm %s/*; fi', $path, $path), $output, $return_val); |
||
24 | |||
25 | // output any errors |
||
26 | if ($return_val != 0) { |
||
27 | user_error(sprintf('%s failed: ', get_class($this)) . implode("\n", $output), E_USER_ERROR); |
||
28 | } |
||
31 |