main
inicio
This commit is contained in:
11
app/helpers/env.php
Normal file
11
app/helpers/env.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
function loadEnv($path = __DIR__ . '/../../.env') {
|
||||
if (!file_exists($path)) return;
|
||||
|
||||
$lines = file($path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||
foreach ($lines as $line) {
|
||||
if (str_starts_with(trim($line), '#')) continue;
|
||||
list($name, $value) = explode('=', $line, 2);
|
||||
$_ENV[trim($name)] = trim($value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user