- Added getenvonce() method which was missing

This commit is contained in:
Dave Mc Nicoll 2026-07-14 20:13:20 +00:00
parent 27bfdd5902
commit 72e50fbe50

View File

@ -4,6 +4,16 @@ use Negundo\Client\{ SoftwareConfig, Dump, Task, NegundoMiddleware };
use function DI\{ autowire, create, get, add };
if (! function_exists('getenvonce')) {
function getenvonce(string $name) : array|string|false
{
$value = getenv($name);
unset($_ENV[$name], $_SERVER[$name]);
putenv($name . "=");
return $value;
}
}
return [
SoftwareConfig::class => create(SoftwareConfig::class)->constructor(
serverUrl: getenvonce('NEGUNDO_SERVER'),