Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | public function actionGenerate($path, $size) |
||
34 | { |
||
35 | $thumbnail = new Thumbnail($path, $size); |
||
36 | $thumbnail->generate(); |
||
37 | |||
38 | $path = $thumbnail->getPath(); |
||
39 | |||
40 | if ($path === false) |
||
41 | throw new PageNotFoundException(); |
||
42 | |||
43 | header('Content-Type: '.CFileHelper::getMimeType($path)); |
||
44 | readfile($path); |
||
45 | exit; |
||
|
|||
46 | } |
||
48 | } |
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.