2025-05-16 20:02:49 -04:00
|
|
|
<?php
|
|
|
|
|
// Load environment variables
|
|
|
|
|
$envFile = __DIR__ . '/../.env';
|
2026-01-01 16:52:35 -05:00
|
|
|
$envVars = parse_ini_file($envFile, false, INI_SCANNER_TYPED);
|
|
|
|
|
|
|
|
|
|
// Strip quotes from values if present (parse_ini_file may include them)
|
|
|
|
|
if ($envVars) {
|
|
|
|
|
foreach ($envVars as $key => $value) {
|
|
|
|
|
if (is_string($value)) {
|
|
|
|
|
if ((substr($value, 0, 1) === '"' && substr($value, -1) === '"') ||
|
|
|
|
|
(substr($value, 0, 1) === "'" && substr($value, -1) === "'")) {
|
|
|
|
|
$envVars[$key] = substr($value, 1, -1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-05-16 20:02:49 -04:00
|
|
|
|
|
|
|
|
// Global configuration
|
|
|
|
|
$GLOBALS['config'] = [
|
|
|
|
|
'DB_HOST' => $envVars['DB_HOST'] ?? 'localhost',
|
|
|
|
|
'DB_USER' => $envVars['DB_USER'] ?? 'root',
|
|
|
|
|
'DB_PASS' => $envVars['DB_PASS'] ?? '',
|
|
|
|
|
'DB_NAME' => $envVars['DB_NAME'] ?? 'tinkertickets',
|
2025-09-05 11:08:56 -04:00
|
|
|
'BASE_URL' => '', // Empty since we're serving from document root
|
2025-05-16 20:02:49 -04:00
|
|
|
'ASSETS_URL' => '/assets', // Assets URL
|
|
|
|
|
'API_URL' => '/api' // API URL
|
2025-09-05 11:08:56 -04:00
|
|
|
];
|
|
|
|
|
?>
|