| Conditions | 6 |
| Paths | 6 |
| Total Lines | 27 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function read($sConfigFile) |
||
| 25 | { |
||
| 26 | if(!($sConfigFile = trim($sConfigFile))) |
||
| 27 | { |
||
| 28 | return []; |
||
| 29 | } |
||
| 30 | |||
| 31 | $sExt = pathinfo($sConfigFile, PATHINFO_EXTENSION); |
||
| 32 | switch($sExt) |
||
| 33 | { |
||
| 34 | case 'php': |
||
| 35 | $aConfigOptions = Php::read($sConfigFile); |
||
| 36 | break; |
||
| 37 | case 'yaml': |
||
| 38 | case 'yml': |
||
| 39 | $aConfigOptions = Yaml::read($sConfigFile); |
||
| 40 | break; |
||
| 41 | case 'json': |
||
| 42 | $aConfigOptions = Json::read($sConfigFile); |
||
| 43 | break; |
||
| 44 | default: |
||
| 45 | $sErrorMsg = jaxon_trans('errors.file.extension', ['path' => $sConfigFile]); |
||
| 46 | throw new \Jaxon\Utils\Config\Exception\File($sErrorMsg); |
||
| 47 | } |
||
| 48 | |||
| 49 | return $aConfigOptions; |
||
| 50 | } |
||
| 51 | |||
| 67 |