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