8 use Elgg\Traits\Loggable;
10 use Symfony\Component\HttpFoundation\JsonResponse;
11 use Symfony\Component\HttpFoundation\RedirectResponse;
12 use Symfony\Component\HttpFoundation\Response;
45 $request = Request::createFromGlobals();
47 'Cache-Control' =>
'no-store, must-revalidate',
48 'Expires' =>
'Fri, 05 Feb 1982 00:00:00 -0500',
63 if (!$app || !$app->internal_services) {
64 $msg =
"Exception loading Elgg core. Check log at time {$now}";
73 $services = $app->internal_services;
74 if ($services->responseFactory->getSentResponse() !==
null) {
81 $exception_include = $services->config->exception_include;
83 if ($exception_include && is_file($exception_include)) {
87 include $exception_include;
89 $exception_output = ob_get_clean();
93 if (!empty($exception_output)) {
108 if ($services->request->isXmlHttpRequest()) {
109 $services->views->setViewtype(
'json');
112 $services->views->setViewtype(
'failsafe');
124 }
catch (\Throwable $e) {
127 $this->
log(LogLevel::CRITICAL, $e);
129 $msg =
"Fatal error in exception handler. Check log for Exception at time {$now}";
log($level, $message, array $context=[])
Log a message.
Handler for uncaught exceptions.
__invoke(\Throwable $exception)
Intercepts, logs, and displays uncaught exceptions.
static $_instance
Reference to the loaded Application.
static isCli()
Is application running in CLI.
Thrown when there is a major problem with the installation.
const ELGG_HTTP_INTERNAL_SERVER_ERROR
const ELGG_HTTP_TEMPORARY_REDIRECT
elgg_echo(string $message_key, array $args=[], string $language='')
Elgg language module Functions to manage language and translations.
elgg_view_page(string $title, string|array $body, string $page_shell='default', array $vars=[])
Assembles and outputs a full page.
elgg_view(string $view, array $vars=[], string $viewtype='')
Return a parsed view.