- Added getenvonce

This commit is contained in:
Dave Mc Nicoll 2026-06-01 15:13:11 +00:00
parent 9cd6f10d7e
commit 81e124b144

View File

@ -1,3 +1,13 @@
<?php <?php
if (! function_exists('getenvonce')) {
function getenvonce(string $name) : array|string|false
{
$value = getenv($name);
unset($_ENV[$name], $_SERVER[$name]);
putenv($name . "=");
return $value;
}
}
return require("env/" . ( getenv('APP_ENV') ?? 'prod' ) . ".php"); return require("env/" . ( getenv('APP_ENV') ?? 'prod' ) . ".php");