Revert "cleanup environment variables related to global configuration after instantiating config object"

This reverts commit e4f1480453.
This commit is contained in:
Andrew Dolgov 2025-04-08 18:38:10 +03:00
parent 44e23469a0
commit f9e8911727
No known key found for this signature in database
GPG Key ID: 1A56B4FA25D4AF2A
2 changed files with 0 additions and 12 deletions

View File

@ -156,8 +156,6 @@ 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

View File

@ -285,11 +285,6 @@ 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 ];
@ -448,11 +443,6 @@ 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 ];
}