| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public function __construct($basePath, $cfgFile = 'conf/sspks.yaml') |
||
| 22 | { |
||
| 23 | $this->basePath = $basePath; |
||
| 24 | $this->cfgFile = $this->basePath . DIRECTORY_SEPARATOR . $cfgFile; |
||
| 25 | |||
| 26 | if (!file_exists($this->cfgFile)) { |
||
| 27 | throw new \Exception('Config file "' . $this->cfgFile . '" not found!'); |
||
| 28 | } |
||
| 29 | |||
| 30 | try { |
||
| 31 | /** @var array $config */ |
||
| 32 | $config = Yaml::parse(file_get_contents($this->cfgFile)); |
||
| 33 | } catch (ParseException $e) { |
||
| 34 | throw new \Exception($e->getMessage()); |
||
| 35 | } |
||
| 36 | |||
| 37 | $this->config = $config; |
||
| 38 | } |
||
| 39 | |||
| 62 |