fuc/src/Services/Boot.php
2025-02-23 13:30:57 +08:00

33 lines
590 B
PHP
Executable File

<?php
declare(strict_types=1);
namespace App\Services;
use function date_default_timezone_set;
use function microtime;
use function Sentry\init;
final class Boot
{
public static function setTime(): void
{
date_default_timezone_set($_ENV['timeZone']);
View::$beginTime = microtime(true);
}
public static function bootDb(): void
{
DB::init();
}
public static function bootSentry(): void
{
if ($_ENV['sentry_dsn'] !== '') {
init([
'dsn' => $_ENV['sentry_dsn'],
]);
}
}
}