- Added getenvonce method

This commit is contained in:
Dev 2026-06-09 19:27:43 +00:00
parent b6212b3662
commit 77a13960f2

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");