Initial commit - Last War messaging system

This commit is contained in:
2026-02-19 01:33:28 -06:00
commit 38a8447a64
2162 changed files with 216183 additions and 0 deletions

32
includes/env_loader.php Executable file
View File

@@ -0,0 +1,32 @@
<?php
function loadEnv(string $path): void
{
if (!file_exists($path)) {
return;
}
$lines = file($path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach ($lines as $line) {
if (strpos(trim($line), '#') === 0) {
continue;
}
if (strpos($line, '=') !== false) {
list($key, $value) = explode('=', $line, 2);
$key = trim($key);
$value = trim($value);
if (!array_key_exists($key, $_ENV)) {
$_ENV[$key] = $value;
}
if (!getenv($key)) {
putenv("$key=$value");
}
}
}
}
loadEnv(__DIR__ . '/../.env');