misuzu/misuzu.php

29 lines
756 B
PHP
Raw Normal View History

<?php
namespace Misuzu;
define('MSZ_STARTUP', microtime(true));
define('MSZ_ROOT', __DIR__);
2025-02-09 20:44:10 +00:00
require_once __DIR__ . '/vendor/autoload.php';
2025-02-09 23:34:28 +00:00
\Dotenv\Dotenv::createImmutable(Misuzu::PATH_ROOT)->load();
if(!empty($_ENV['SENTRY_DSN']))
\Sentry\init(['dsn' => $_ENV['SENTRY_DSN']]);
2025-02-09 23:34:28 +00:00
(function(\Whoops\RunInterface $whoops) {
if(Misuzu::cli())
$whoops->pushHandler(new Whoops\SentryPlainTextHandler);
elseif(Misuzu::debug())
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
else
$whoops->pushHandler(new Whoops\SentryPageHandler);
2025-02-09 23:34:28 +00:00
$whoops->register();
})(new \Whoops\Run);
2025-02-09 23:34:28 +00:00
$msz = new MisuzuContext(
$_ENV['DATABASE_DSN'] ?? 'null:',
$_ENV['DOMAIN_ROLES'] ?? 'localhost=main,redirect:/go'
);