<?php
date_default_timezone_set('Africa/Johannesburg');
require_once __DIR__ . '/config/app.php';

$dsn = 'mysql:host=' . RBE_DB_HOST . ';dbname=' . RBE_DB_NAME . ';charset=' . RBE_DB_CHARSET;
$options = [
    PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
    PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
    PDO::ATTR_EMULATE_PREPARES => false,
];

try {
    $conn_rbe = new PDO($dsn, RBE_DB_USER, RBE_DB_PASS, $options);
} catch (PDOException $e) {
    exit('RBE DB connection failed: ' . $e->getMessage());
}

// Compatibility aliases retained for legacy code paths in the delivered fork.
$conn_master = $conn_rbe;
$conn_main = $conn_rbe;
