Use .env file instead of local config.
This commit is contained in:
parent
4110cd5190
commit
e1cb500f99
16 changed files with 517 additions and 98 deletions
public
|
@ -9,23 +9,6 @@ require_once __DIR__ . '/../misuzu.php';
|
|||
if(!isset($msz) || !($msz instanceof \Misuzu\MisuzuContext))
|
||||
die('Misuzu is not initialised.');
|
||||
|
||||
if(class_exists(\Whoops\Run::class))
|
||||
(function($whoops) {
|
||||
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
|
||||
$whoops->register();
|
||||
})(new \Whoops\Run);
|
||||
else
|
||||
set_exception_handler(function(\Throwable $ex) {
|
||||
\Sentry\captureException($ex);
|
||||
|
||||
http_response_code(500);
|
||||
ob_clean();
|
||||
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
header('X-Accel-Redirect: /error-500.html');
|
||||
exit;
|
||||
});
|
||||
|
||||
// The whole wall of shit before the router setup and dispatch should be worked away
|
||||
// Lockdown things should be middleware when there's no more legacy files
|
||||
|
||||
|
@ -128,7 +111,7 @@ CSRF::init(
|
|||
$router = $msz->createRouting($request);
|
||||
$msz->startTemplating();
|
||||
|
||||
if(in_array('main', $msz->env->getArray(sprintf('domain:%s', $request->getHeaderLine('Host'))))) {
|
||||
if($msz->domainRoles->hasRole($request->getHeaderLine('Host'), 'main')) {
|
||||
$mszRequestPath = substr($request->path, 1);
|
||||
$mszLegacyPathPrefix = Misuzu::PATH_PUBLIC_LEGACY . '/';
|
||||
$mszLegacyPath = $mszLegacyPathPrefix . $mszRequestPath;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue