<?php
// --- CONFIGURATION DE LA BASE DE DONNÉES ---
$host    = 'localhost';
$db      = 'jetegage_db_jetegage';
$user    = 'jetegage_brain';
$pass    = 'W1cr00nd3s';
$charset = 'utf8mb4';

$dsn = "mysql:host=$host;dbname=$db;charset=$charset";
$options = [
    PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION,
    PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
    PDO::ATTR_EMULATE_PREPARES   => false,
];

try {
    $pdo = new PDO($dsn, $user, $pass, $options);
} catch (\PDOException $e) {
    // Ne jamais afficher l'erreur en production
    error_log("DB Connection failed: " . $e->getMessage());
    die(json_encode(['error' => 'Connexion à la base de données impossible.']));
}

// --- VARIABLES GLOBALES ---
$nom_du_site = "JeTeGageQue";
$devise      = "Gages";
$UPLOAD_DIR  = __DIR__ . '/uploads/';
$UPLOAD_URL  = 'uploads/';
?>
