36 lines
1.1 KiB
PHP
Executable File
36 lines
1.1 KiB
PHP
Executable File
<?php
|
|
|
|
require_once __DIR__ . '/error_logging.php';
|
|
|
|
$envFile = dirname(__DIR__) . '/.env';
|
|
if (file_exists($envFile)) {
|
|
$lines = file($envFile, 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);
|
|
$_ENV[$key] = $value;
|
|
putenv("$key=$value");
|
|
}
|
|
}
|
|
}
|
|
|
|
if (!defined('BASE_PATH')) {
|
|
define('BASE_PATH', dirname(__DIR__));
|
|
}
|
|
|
|
return [
|
|
'db' => [
|
|
'host' => getenv('DB_HOST') ?: 'localhost',
|
|
'port' => getenv('DB_PORT') ?: '3306',
|
|
'database' => getenv('DB_NAME') ?: 'contenedor_ibiza',
|
|
'username' => getenv('DB_USER') ?: 'root',
|
|
'password' => getenv('DB_PASS') ?: '',
|
|
],
|
|
'site_url' => getenv('SITE_URL') ?: 'http://localhost:8080',
|
|
'telegram_bot_token' => getenv('TELEGRAM_BOT_TOKEN') ?: '',
|
|
'session_name' => getenv('SESSION_NAME') ?: 'contenedor_session',
|
|
];
|