allow blank override values
This commit is contained in:
parent
77b5201b7d
commit
5bb8714839
|
@ -139,7 +139,7 @@ class Config {
|
|||
|
||||
list ($defval, $deftype) = $this::_DEFAULTS[$const];
|
||||
|
||||
$this->params[$cvalue] = [ self::cast_to(!empty($override) ? $override : $defval, $deftype), $deftype ];
|
||||
$this->params[$cvalue] = [ self::cast_to($override !== false ? $override : $defval, $deftype), $deftype ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -264,7 +264,7 @@ class Config {
|
|||
private function _add(string $param, string $default, int $type_hint) {
|
||||
$override = getenv($this::_ENVVAR_PREFIX . $param);
|
||||
|
||||
$this->params[$param] = [ self::cast_to(!empty($override) ? $override : $default, $type_hint), $type_hint ];
|
||||
$this->params[$param] = [ self::cast_to($override !== false ? $override : $default, $type_hint), $type_hint ];
|
||||
}
|
||||
|
||||
static function add(string $param, string $default, int $type_hint = Config::T_STRING) {
|
||||
|
|
Loading…
Reference in New Issue