<?php
// ── Production (cPanel) ──
define('DB_HOST', 'localhost');
define('DB_NAME', 'kmctesti_bancharee');
define('DB_USER', 'kmctesti_admin');
define('DB_PASS', 'ragassagar1298@');
define('BASE_URL', 'https://banchare.com.kmctestinternal.xyz');

define('JWT_SECRET', 'bnch_2026_jwt_secret_key_change_before_prod');
define('UPLOAD_DIR', __DIR__ . '/../uploads/');
define('UPLOAD_URL', BASE_URL . '/uploads/');

try {
    $pdo = new PDO(
        'mysql:host=' . DB_HOST . ';dbname=' . DB_NAME . ';charset=utf8mb4',
        DB_USER,
        DB_PASS,
        [
            PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION,
            PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
            PDO::ATTR_EMULATE_PREPARES   => false,   // real prepared statements (faster, safer)
            PDO::ATTR_STRINGIFY_FETCHES  => false,   // return native PHP types (int, float)
            PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci",
        ]
    );
} catch (PDOException $e) {
    http_response_code(500);
    echo json_encode(['error' => 'DB connection failed']);
    exit;
}
