23 lines
614 B
PHP
23 lines
614 B
PHP
<?php
|
|
$app = require_once implode(DIRECTORY_SEPARATOR, [
|
|
dirname(__FILE__, 2),
|
|
'setup',
|
|
'app.php'
|
|
]);
|
|
try {
|
|
$app->run();
|
|
} catch (Error $error) {
|
|
$app->getContainer()->get(Psr\Log\LoggerInterface::class)->error($error);
|
|
header('Location: /construccion');
|
|
} catch (Exception $exception) {
|
|
$app->getContainer()->get(Psr\Log\LoggerInterface::class)->notice($exception);
|
|
header('Location: /construccion');
|
|
}
|
|
register_shutdown_function(function() {
|
|
$error = error_get_last();
|
|
|
|
if ($error !== null) {
|
|
error_log(json_encode($error).PHP_EOL,3, '/logs/fatal.log');
|
|
}
|
|
});
|