| Conditions | 4 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 37 | private function loadEnvironment() |
||
| 38 | { |
||
| 39 | if (!file_exists(realpath($this->dir) . '/' . $this->filename)) { |
||
| 40 | return false; |
||
| 41 | } |
||
| 42 | |||
| 43 | if (class_exists('Dotenv\Dotenv')) { //2.x branch |
||
| 44 | $dotenv = new \Dotenv\Dotenv($this->dir, $this->filename); |
||
| 45 | $dotenv->load(); |
||
| 46 | |||
| 47 | return true; |
||
| 48 | } elseif (class_exists('DotEnv')) { //1.x branch |
||
| 49 | \Dotenv::load($this->dir, $this->filename); |
||
| 50 | |||
| 51 | return true; |
||
| 52 | } |
||
| 53 | |||
| 54 | throw new \RuntimeException('no suitable .env loader found'); |
||
| 55 | } |
||
| 56 | } |
||
| 57 |