1 | <?php |
||
2 | |||
3 | use Gravatalonga\Container; |
||
4 | |||
5 | if (!function_exists('env')) { |
||
6 | function env($name, $default = null) |
||
7 | { |
||
8 | if ($value = getenv($name)) { |
||
9 | return $value; |
||
10 | } |
||
11 | return $default; |
||
12 | } |
||
13 | } |
||
14 | |||
15 | if (!function_exists('dd')) { |
||
16 | function dd() { |
||
17 | array_map(function ($x) { |
||
18 | dump($x); |
||
19 | }, func_get_args()); |
||
20 | die; |
||
0 ignored issues
–
show
|
|||
21 | } |
||
22 | } |
||
23 | |||
24 | if (!function_exists('app')) { |
||
25 | function app() |
||
26 | { |
||
27 | return Container::getInstance(); |
||
28 | } |
||
29 | } |
||
30 | |||
31 | if (!function_exists('path')) { |
||
32 | function path($folder = '') |
||
33 | { |
||
34 | return rtrim(app()->get('settings')['base_path'] . '/' . $folder, '/'); |
||
35 | } |
||
36 | } |
||
37 |
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.