| Total Complexity | 3 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 10 | class ThumbnailController extends Controller |
||
| 11 | { |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Disable all default filters (including authentication) since the generate action |
||
| 15 | * may be called from e.g. a media player which naturally isn't |
||
| 16 | * authenticated |
||
| 17 | * @return array the filters for this controller |
||
| 18 | */ |
||
| 19 | public function filters() |
||
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Generates a thumbnail for the specified image path and size, then serves |
||
| 26 | * it to the browser. The next time the same thumbnail is rendered its URL |
||
| 27 | * will point to the generated image instead of this action. |
||
| 28 | * @see Thumbnail |
||
| 29 | * @param string $path the thumbnail path |
||
| 30 | * @param int $size the thumbnail size |
||
| 31 | * @throws PageNotFoundException if the image could not be generated |
||
| 32 | */ |
||
| 33 | public function actionGenerate($path, $size) |
||
| 48 | } |
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.