protected function prepareConf() { $cliConf = []; if ($this->config) { if (!file_exists($this->config)) { throw new InvalidParamException(sprintf("Config file not found (%s)", $this->config)); } $cliConf = (include $this->config); } if ($this->trace !== null) { $cliConf['options']['show_trace'] = (bool) $this->trace; } if ($this->script !== null) { $cliConf['options']['entry_script'] = $this->script; } Conf::setFromCLI($cliConf); }
protected function prepareConf() { $default = Conf::getDefault(); $cli = Conf::getFromCLI(); $this->_options = new Dot(ArrayHelper::merge($default['options'], $this->_options ?? [], $cli['options'] ?? [])); if ($this->_options['entry_script'] === Conf::ENTRY_SCRIPT_CURRENT) { $this->_options['entry_script'] = realpath($_SERVER['argv'][0]); } $this->_entities = ArrayHelper::merge($default['entities'], $this->_entities ?? [], $cli['entities'] ?? []); }