<?php

declare(strict_types=1);

use Core\Database;
use Core\Session;

require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/bootstrap/helpers.php';

loadEnv(__DIR__ . '/.env');

date_default_timezone_set(env('APP_TIMEZONE', 'America/Sao_Paulo'));

if (session_status() === PHP_SESSION_NONE) {
    session_start();
}

Session::sweepFlash();

Database::boot([
    'host' => env('DB_HOST', '127.0.0.1'),
    'port' => env('DB_PORT', '3306'),
    'database' => env('DB_NAME', 'ficha_admissao'),
    'username' => env('DB_USER', 'root'),
    'password' => env('DB_PASS', ''),
    'charset' => 'utf8mb4',
]);
