diff options
| -rw-r--r-- | .docker/app/startup.sh | 2 | ||||
| -rw-r--r-- | classes/Config.php | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/.docker/app/startup.sh b/.docker/app/startup.sh index cf93b7413..6113cf424 100644 --- a/.docker/app/startup.sh +++ b/.docker/app/startup.sh @@ -156,6 +156,8 @@ find ${SCRIPT_ROOT}/sql/post-init.d/ -type f -name '*.sql' | while read F; do $PSQL -f $F done +unset PGPASSWORD + touch $DST_DIR/.app_is_ready exec /usr/sbin/php-fpm${PHP_SUFFIX} --nodaemonize --force-stderr diff --git a/classes/Config.php b/classes/Config.php index 5098bfe68..0774bd76a 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -285,6 +285,11 @@ class Config { if (isset(self::_DEFAULTS[$const])) { $override = getenv(self::_ENVVAR_PREFIX . $const); + // cleanup original env var after importing + putenv(self::_ENVVAR_PREFIX . $const . '='); + unset($_ENV[self::_ENVVAR_PREFIX . $const]); + unset($_SERVER[self::_ENVVAR_PREFIX . $const]); + list ($defval, $deftype) = self::_DEFAULTS[$const]; $this->params[$cvalue] = [ self::cast_to($override !== false ? $override : $defval, $deftype), $deftype ]; @@ -443,6 +448,11 @@ class Config { private function _add(string $param, string $default, int $type_hint): void { $override = getenv(self::_ENVVAR_PREFIX . $param); + // cleanup original env var after importing + putenv(self::_ENVVAR_PREFIX . $param . '='); + unset($_ENV[self::_ENVVAR_PREFIX . $param]); + unset($_SERVER[self::_ENVVAR_PREFIX . $param]); + $this->params[$param] = [ self::cast_to($override !== false ? $override : $default, $type_hint), $type_hint ]; } |