2017-12-16 19:17:29 +00:00
|
|
|
<?php
|
|
|
|
namespace Misuzu;
|
|
|
|
|
2018-09-16 19:45:40 +00:00
|
|
|
define('MSZ_STARTUP', microtime(true));
|
2018-10-04 20:30:55 +00:00
|
|
|
define('MSZ_ROOT', __DIR__);
|
2019-04-30 20:55:12 +00:00
|
|
|
|
2025-02-09 20:44:10 +00:00
|
|
|
require_once __DIR__ . '/vendor/autoload.php';
|
2018-09-16 19:45:40 +00:00
|
|
|
|
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']]);
|
2023-09-10 20:46:58 +00:00
|
|
|
|
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);
|
2023-09-10 20:46:58 +00:00
|
|
|
|
2025-02-09 23:34:28 +00:00
|
|
|
$whoops->register();
|
|
|
|
})(new \Whoops\Run);
|
2018-09-16 21:03:56 +00:00
|
|
|
|
2025-02-09 23:34:28 +00:00
|
|
|
$msz = new MisuzuContext(
|
|
|
|
$_ENV['DATABASE_DSN'] ?? 'null:',
|
|
|
|
$_ENV['DOMAIN_ROLES'] ?? 'localhost=main,redirect:/go'
|
|
|
|
);
|