allow blank override values

This commit is contained in:
Andrew Dolgov 2021-03-07 09:00:36 +03:00
parent 77b5201b7d
commit 5bb8714839
1 changed files with 2 additions and 2 deletions

View File

@ -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) {