Conditions | 4 |
Paths | 4 |
Total Lines | 20 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
39 | public static function read(string $sConfigFile): array |
||
40 | { |
||
41 | if(!extension_loaded('yaml')) |
||
42 | { |
||
43 | throw new YamlExtension(); |
||
44 | } |
||
45 | |||
46 | $sConfigFile = realpath($sConfigFile); |
||
47 | if(!is_readable($sConfigFile)) |
||
48 | { |
||
49 | throw new FileAccess($sConfigFile); |
||
50 | } |
||
51 | |||
52 | $aConfigOptions = yaml_parse_file($sConfigFile); |
||
53 | if(!is_array($aConfigOptions)) |
||
54 | { |
||
55 | throw new FileContent($sConfigFile); |
||
56 | } |
||
57 | |||
58 | return $aConfigOptions; |
||
59 | } |
||
61 |