Files
oficial/app/public/index.php

25 lines
773 B
PHP
Raw Normal View History

<?php
$app = require_once implode(DIRECTORY_SEPARATOR, [
dirname(__FILE__, 2),
'setup',
'app.php'
]);
2023-07-28 16:22:20 -04:00
try {
$app->run();
} catch (Error $error) {
$app->getContainer()->get(Psr\Log\LoggerInterface::class)->error($error);
2023-09-07 23:03:21 -03:00
header('Location: /construccion');
2023-07-28 16:22:20 -04:00
} catch (Exception $exception) {
$app->getContainer()->get(Psr\Log\LoggerInterface::class)->notice($exception);
2023-09-07 23:03:21 -03:00
header('Location: /construccion');
2023-07-28 16:22:20 -04:00
}
register_shutdown_function(function() {
$error = error_get_last();
$fatal_errors = [E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR];
if ($error !== null and in_array($error['type'], $fatal_errors, true)) {
error_log(json_encode($error).PHP_EOL,3, '/logs/fatal.log');
}
error_clear_last();
});