Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public static function getEnvFilePath(): string |
||
29 | { |
||
30 | $defaultEnvPaths = [ |
||
31 | getcwd() . '/.env', |
||
32 | getcwd() . '/../.env', |
||
33 | $_SERVER['DOCUMENT_ROOT'] . '/.env', |
||
34 | ]; |
||
35 | |||
36 | foreach ($defaultEnvPaths as $path) { |
||
37 | if (file_exists($path)) { |
||
38 | return $path; |
||
39 | } |
||
40 | } |
||
41 | |||
42 | return ''; |
||
43 | } |
||
77 | } |