| Conditions | 5 |
| Paths | 4 |
| Total Lines | 27 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | public function setup(string $sConfigFile = '') |
||
| 32 | { |
||
| 33 | if(!file_exists($sConfigFile)) |
||
| 34 | { |
||
| 35 | $sMessage = $this->xTranslator->trans('errors.file.access', ['path' => $sConfigFile]); |
||
| 36 | throw new SetupException($sMessage); |
||
| 37 | } |
||
| 38 | |||
| 39 | // Read the config options. |
||
| 40 | $aOptions = $this->xConfigManager->read($sConfigFile); |
||
| 41 | $aLibOptions = $aOptions['lib'] ?? []; |
||
| 42 | $aAppOptions = $aOptions['app'] ?? []; |
||
| 43 | if(!is_array($aLibOptions) || !is_array($aAppOptions)) |
||
| 44 | { |
||
| 45 | $sMessage = $this->xTranslator->trans('errors.file.content', ['path' => $sConfigFile]); |
||
| 46 | throw new SetupException($sMessage); |
||
| 47 | } |
||
| 48 | // The bootstrap set this to false. It needs to be changed. |
||
| 49 | if(!isset($aLibOptions['core']['response']['send'])) |
||
| 50 | { |
||
| 51 | $aLibOptions['core']['response']['send'] = true; |
||
| 52 | } |
||
| 53 | |||
| 54 | $this->bootstrap() |
||
| 55 | ->lib($aLibOptions) |
||
| 56 | ->app($aAppOptions) |
||
| 57 | ->setup(); |
||
| 58 | } |
||
| 70 |