public function load($arg, $force = false)
{
// should we load config file force ?
if ($force !== true && $this->loaded === true) {
throw new Exception('Can not load config. Config is already loaded.');
}
if ($arg === null || is_bool($arg)) {
$arg = $this->symbolFilename;
}
if (is_string($arg) && file_exists($arg) || $arg === true) {
$this->loadFromFile($arg);
} elseif (is_array($arg)) {
$this->config = self::preprocessConfig($arg);
} else {
throw new Exception('unknown config format.');
}
// XXX: validate config structure if we are migrating to new major version with incompatible changes
/*
if (!isset($this->config['data_source'])) {
throw new Exception('data_source is missing, please update your config file.');
}
*/
$this->loaded = true;
}