(Refactor) Remove getEnvironmentValue, rename setEnvironmentValue to setenv to match php defaults

This commit is contained in:
Jens 2023-03-30 10:32:31 +02:00 committed by IceToast
parent efd61fb376
commit ef1ec46bad

View file

@ -129,22 +129,12 @@ function checkExtensions(): array
* @param string $envValue The environment variable to set * @param string $envValue The environment variable to set
* @return bool true on success or false on failure. * @return bool true on success or false on failure.
*/ */
function setEnvironmentValue(string $envKey, $envValue) function setenv(string $envKey, $envValue)
{ {
$str = "{$envKey}={$envValue}"; $str = "{$envKey}={$envValue}";
return putenv($str); return putenv($str);
} }
/**
* Gets the variable from the env file
* @param string $envKey The environment variable to look for
* @return array|false|string Returns the value if found, otherwise returns false.
*/
function getEnvironmentValue(string $envKey): array|false|string
{
return getenv($envKey);
}
/** /**
* Encrypt the given value * Encrypt the given value