Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
29 | public function index() |
||
30 | { |
||
31 | if($javascript = file_get_contents(PATH_PUBLIC . 'assets/sw.js')) { |
||
32 | $javascript = str_replace(['{{$theme}}', '{{ $theme }}'], 'default', $javascript); |
||
33 | |||
34 | header("Content-type: application/x-javascript"); |
||
35 | echo $javascript; |
||
36 | |||
37 | exit(EXIT_SUCCESS); |
||
|
|||
38 | } |
||
40 | } |
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.