Updated to latest shlink-installer and shlink-config, ensuring env vars are properly loaded

This commit is contained in:
Alejandro Celaya
2022-01-15 16:06:24 +01:00
parent c6f16b0558
commit 91192a8a8f
3 changed files with 4 additions and 31 deletions

View File

@@ -13,13 +13,9 @@ use PUGX\Shortid\Factory as ShortIdFactory;
use Shlinkio\Shlink\Common\Util\DateRange;
use function Functional\reduce_left;
use function implode;
use function is_array;
use function is_scalar;
use function print_r;
use function putenv;
use function Shlinkio\Shlink\Common\buildDateRange;
use function Shlinkio\Shlink\Config\env;
use function sprintf;
use function str_repeat;
@@ -120,18 +116,3 @@ function fieldWithUtf8Charset(FieldBuilder $field, array $emConfig, string $coll
default => $field,
};
}
function putNotYetDefinedEnv(string $key, mixed $value): void
{
$isArray = is_array($value);
if (!($isArray || is_scalar($value)) || env($key) !== null) {
return;
}
$normalizedValue = $isArray ? implode(',', $value) : match ($value) {
true => 'true',
false => 'false',
default => $value,
};
putenv(sprintf('%s=%s', $key, $normalizedValue));
}