<?php

declare(strict_types=1);

$host = 'localhost';
$database = 'OppulentChemicalls';
$username = 'OppulentChemicalls';
$password = 'OppulentChemicalls';

try {
    $pdo = new PDO(
        "mysql:host={$host};dbname={$database};charset=utf8mb4",
        $username,
        $password,
        [
            PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
            PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
            PDO::ATTR_EMULATE_PREPARES => false,
        ]
    );
} catch (PDOException $exception) {
    error_log('Pure Chemical database connection failed: ' . $exception->getMessage());
    http_response_code(500);
    exit('Database connection failed. Check that MySQL is running and the pure_chemical database is configured.');
}

if (!defined('SITE_NAME')) {
    define('SITE_NAME', 'Pure Chemical');
}
