summaryrefslogtreecommitdiff
path: root/classes/config.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-25 09:33:36 +0300
committerAndrew Dolgov <[email protected]>2021-02-25 09:33:36 +0300
commit988eb3ac91f039583fcc56fb8d551106592e80bf (patch)
treeb55e7c059d381a837d13579d55c6371a4ff5864b /classes/config.php
parent922a6992153a95b0639253752a6125a45d4fd3ab (diff)
initial (wip) for new prefs
Diffstat (limited to 'classes/config.php')
-rw-r--r--classes/config.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/classes/config.php b/classes/config.php
index effbb78ad..95bf3bf71 100644
--- a/classes/config.php
+++ b/classes/config.php
@@ -124,12 +124,12 @@ class Config {
list ($defval, $deftype) = $this::_DEFAULTS[$const];
- $this->params[$cvalue] = [ $this->cast_to(!empty($override) ? $override : $defval, $deftype), $deftype ];
+ $this->params[$cvalue] = [ self::cast_to(!empty($override) ? $override : $defval, $deftype), $deftype ];
}
}
}
- private function cast_to(string $value, int $type_hint) {
+ static function cast_to(string $value, int $type_hint) {
switch ($type_hint) {
case self::T_BOOL:
return sql_bool_to_bool($value);
@@ -149,7 +149,7 @@ class Config {
private function _add(string $param, string $default, int $type_hint) {
$override = getenv($this::_ENVVAR_PREFIX . $param);
- $this->params[$param] = [ $this->cast_to(!empty($override) ? $override : $default, $type_hint), $type_hint ];
+ $this->params[$param] = [ self::cast_to(!empty($override) ? $override : $default, $type_hint), $type_hint ];
}
static function add(string $param, string $default, int $type_hint = Config::T_STRING) {