D4rkMindz /
gracili
| 1 | <?php |
||
| 2 | |||
| 3 | $defaults = require __DIR__ . '/defaults.php'; |
||
| 4 | |||
| 5 | $env = []; |
||
| 6 | |||
| 7 | if (file_exists(__DIR__ . '/../../env.php')) { |
||
| 8 | $env = require __DIR__ . '/../../env.php'; |
||
| 9 | } elseif (file_exists(__DIR__ . '/env.php')) { |
||
| 10 | $env = require __DIR__ . '/env.php'; |
||
| 11 | } else { |
||
| 12 | throw new RuntimeException('Env not found'); |
||
| 13 | } |
||
| 14 | |||
| 15 | if (defined('APP_ENV')) { |
||
| 16 | $config = require __DIR__ . '/' . APP_ENV . '.php'; |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 17 | $defaults = array_replace_recursive($defaults, $config); |
||
| 18 | } |
||
| 19 | |||
| 20 | $defaults = array_replace_recursive($defaults, $env); |
||
| 21 | |||
| 22 | return $defaults; |