Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function load(string $dir): void |
||
16 | { |
||
17 | if (file_exists((string) realpath(sprintf('%s/.env', $dir)))) { |
||
18 | PhpDotenv::createImmutable($dir)->load(); |
||
19 | |||
20 | return; |
||
21 | } |
||
22 | |||
23 | if (! file_exists((string) realpath(sprintf('%s/.env.dist', $dir)))) { |
||
24 | return; |
||
25 | } |
||
26 | |||
27 | (PhpDotenv::createImmutable($dir, '.env.dist'))->load(); |
||
28 | } |
||
29 | } |
||
30 |