Produktions-Env-Loading fuer echtes Webhosting ergaenzen

PHP-FPM/mod_php auf Shared Hosting erbt keine shell-exportierten
Umgebungsvariablen wie der lokale Dev-Server. app/bootstrap.php laedt
jetzt optional env.local.php (nicht eingecheckt, siehe
env.local.example.php als Vorlage) und setzt die Variablen per
putenv(), bevor irgendein app_env()/getenv()-Aufruf passiert. Greift
jetzt auch fuer CLI-Skripte (migrate.php, grant-platform-admin.php) ueber
scripts/dev-db.php.
This commit is contained in:
2026-07-17 11:40:08 +02:00
parent cb799c7c66
commit b6199623c5
4 changed files with 62 additions and 0 deletions
+2
View File
@@ -2,6 +2,8 @@
declare(strict_types=1);
require_once __DIR__ . '/../app/bootstrap.php';
function dev_required_env(string $name): string
{
$value = getenv($name);