<?php

$DB_HOST = getenv('DB_HOST') ?: 'mis-mysql';
$DB_NAME = getenv('DB_NAME') ?: 'goiintra_db';
$DB_USER = getenv('DB_USER') ?: 'goiintra_root';
$DB_PASSWORD = getenv('DB_PASSWORD') ?: 'L0C2CKN5GHHY';

try {
    $pdo = new PDO(
        "mysql:host={$DB_HOST};dbname={$DB_NAME};charset=utf8",
        $DB_USER,
        $DB_PASSWORD,
        [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]
    );
} catch (PDOException $e) {
    error_log($e->getMessage());
    exit('[DB Error. Please contact administrator.]');
}