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