mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-12 01:54:41 +08:00
Updated to latest shlink-installer and shlink-config, ensuring env vars are properly loaded
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user