Update besar apk finance
This commit is contained in:
@@ -1,4 +1,28 @@
|
||||
<?php
|
||||
// Muat environment lokal untuk development/XAMPP. File .env tidak boleh di-commit.
|
||||
$localEnvFile = __DIR__ . DIRECTORY_SEPARATOR . '.env';
|
||||
if (is_file($localEnvFile) && is_readable($localEnvFile)) {
|
||||
foreach (file($localEnvFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) as $envLine) {
|
||||
$envLine = trim($envLine);
|
||||
if ($envLine === '' || strpos($envLine, '#') === 0 || strpos($envLine, '=') === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
list($envName, $envValue) = array_map('trim', explode('=', $envLine, 2));
|
||||
if (!preg_match('/^[A-Z][A-Z0-9_]*$/', $envName) || getenv($envName) !== false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strlen($envValue) >= 2 && (($envValue[0] === '"' && substr($envValue, -1) === '"') || ($envValue[0] === "'" && substr($envValue, -1) === "'"))) {
|
||||
$envValue = substr($envValue, 1, -1);
|
||||
}
|
||||
|
||||
putenv($envName . '=' . $envValue);
|
||||
$_ENV[$envName] = $envValue;
|
||||
$_SERVER[$envName] = $envValue;
|
||||
}
|
||||
}
|
||||
|
||||
// Composer autoload
|
||||
$composer_autoload = __DIR__ . '/vendor/autoload.php';
|
||||
if (file_exists($composer_autoload)) {
|
||||
|
||||
Reference in New Issue
Block a user