bootstrap.php
570 Bytes
<?php
declare(strict_types=1);
error_reporting(E_ALL);
ini_set('display_errors', '0'); // nunca mostrar erro cru em produção
spl_autoload_register(static function (string $class): void {
$file = __DIR__ . '/' . $class . '.php';
if (is_file($file)) {
require $file;
}
});
set_exception_handler(static function (Throwable $e): void {
error_log('Uncaught: ' . $e->getMessage() . ' in ' . $e->getFile() . ':' . $e->getLine());
http_response_code(500);
echo 'Ocorreu um erro inesperado. Tente novamente mais tarde.';
});
Auth::start();