- Added getenvonce

This commit is contained in:
Dave Mc Nicoll committed 2026-06-01 15:23:49 +00:00
1 parent 9cd6f10d7e
commit 81e124b144
1 file changed
+10
+10
View File
@@ -1,3 +1,13 @@
<?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");