| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 42 | 2 | public function setup(array $conf) |
|
| 43 | { |
||
| 44 | 2 | $path = AppUtil\Arr::getValue($conf, 'file', '.env'); |
|
| 45 | 2 | $this->file = AppUtil\Path::toAbsolutePath($path, Configuration::getWorkingDirectory()); |
|
| 46 | 2 | ||
| 47 | 2 | // dotenv version 4 and higher |
|
| 48 | 2 | if (method_exists('Dotenv\\Dotenv','createImmutable')) { |
|
| 49 | $this->dotenv = DotenvLib::createImmutable(dirname($this->file), basename($this->file)); |
||
| 50 | } else { |
||
| 51 | $this->dotenv = DotenvLib::create(dirname($this->file), basename($this->file)); |
||
|
|
|||
| 52 | } |
||
| 53 | $this->dotenv->load(); |
||
| 54 | } |
||
| 67 |