Conditions | 4 |
Paths | 10 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
32 | protected function parseFile(string $strConfigFile) : array |
||
33 | { |
||
34 | if (!file_exists($strConfigFile)) { |
||
35 | trigger_error('Config File (' . $strConfigFile . ') does not exist!', E_USER_WARNING); |
||
36 | } |
||
37 | |||
38 | $strNeon = file_get_contents($strConfigFile); |
||
39 | $aNeon = []; |
||
|
|||
40 | try { |
||
41 | $aNeon = Neon::decode($strNeon); |
||
42 | if (!is_array($aNeon)) { |
||
43 | trigger_error('Config file (' . $strConfigFile . ') do not contain config informations!', E_USER_ERROR); |
||
44 | } |
||
45 | } catch (\Exception $e) { |
||
46 | trigger_error('Invalid config file (' . $strConfigFile . '): ' . $e->getMessage(), E_USER_ERROR); |
||
47 | } |
||
48 | |||
49 | return $aNeon; |
||
50 | } |
||
52 |