| Conditions | 4 |
| Paths | 4 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public static function read($sConfigFile) |
||
| 27 | { |
||
| 28 | $sConfigFile = realpath($sConfigFile); |
||
| 29 | if(!extension_loaded('yaml')) |
||
| 30 | { |
||
| 31 | throw new \Jaxon\Config\Exception\Yaml(jaxon_trans('config.errors.yaml.install')); |
||
| 32 | } |
||
| 33 | if(!is_readable($sConfigFile)) |
||
| 34 | { |
||
| 35 | throw new \Jaxon\Config\Exception\File(jaxon_trans('config.errors.file.access', array('path' => $sConfigFile))); |
||
| 36 | } |
||
| 37 | $aConfigOptions = yaml_parse_file($sConfigFile); |
||
| 38 | if(!is_array($aConfigOptions)) |
||
| 39 | { |
||
| 40 | throw new \Jaxon\Config\Exception\File(jaxon_trans('config.errors.file.content', array('path' => $sConfigFile))); |
||
| 41 | } |
||
| 42 | |||
| 43 | return $aConfigOptions; |
||
| 44 | } |
||
| 45 | } |
||
| 46 |