application->checkRequiredPhpExtensions(); } catch (MissingExtensionException $exception) { // Disables template caching because the cache directory is not known yet. $this->template->disableCache(); $output = $this->template->render('error/generic', [ 'lang' => 'en', 'dir' => 'ltr', 'error_message' => $exception->getMessage(), ]); $response = $this->responseFactory->createResponse(StatusCodeInterface::STATUS_INTERNAL_SERVER_ERROR); $response->getBody()->write($output); return $response; } return $handler->handle($request); } }