<?php
$dotenv = parse_ini_file('.env');

define('DB_HOST', $dotenv['DB_HOST'] ?? 'localhost');
define('DB_NAME', $dotenv['DB_NAME'] ?? 'trafficlight');
define('DB_USER', $dotenv['DB_USER'] ?? 'root');
define('DB_PASS', $dotenv['DB_PASS'] ?? '');
define('MAPBOX_API_KEY', $dotenv['MAPBOX_API_KEY'] ?? '');

define('SESSION_DURATION', 60*60*24*30); // 30 days
define('COOKIE_PATH', '/');
define('COOKIE_DOMAIN', '');
define('COOKIE_SECURE', isset($_SERVER['HTTPS']));
define('COOKIE_HTTP', true);

define('SALT', $dotenv['SALT'] ?? 'trafficlight_salt');
?>