78 HttpStatus::header( $this->httpCode );
79 header(
'Content-type: text/html; charset=utf-8' );
85 $logger = LoggerFactory::getInstance(
'HttpError' );
94 'line' => $this->getLine(),
98 $logMsg =
"$content ({http_code}) from {file}:{line}";
101 $logger->info( $logMsg, $context );
103 $logger->error( $logMsg, $context );
114 if ( $this->
header ===
null ) {
115 $titleHtml = htmlspecialchars( HttpStatus::getMessage( $this->httpCode ) );
117 $titleHtml = $this->
header->escaped();
119 $titleHtml = htmlspecialchars( $this->
header );
122 if ( $this->content instanceof
Message ) {
123 $contentHtml = $this->content->escaped();
125 $contentHtml = nl2br( htmlspecialchars( $this->content ) );
128 return "<!DOCTYPE html>\n" .
129 "<html><head><title>$titleHtml</title></head>\n" .
130 "<body><h1>$titleHtml</h1><p>$contentHtml</p></body></html>\n";
getFile()
Get the file for this page, if one exists.
Show an error that looks like an HTTP server error.
report()
Report and log the HTTP error.
getStatusCode()
Returns the HTTP status code supplied to the constructor.
__construct( $httpCode, $content, $header=null)
Stable to call.
isLoggable()
We don't want the default exception logging as we got our own logging set up in self::report.
getHTML()
Returns HTML for reporting the HTTP error.
static header( $header)
Send a header, if we haven't already sent them.
The Message class deals with fetching and processing of interface message into a variety of formats.
while(( $__line=Maintenance::readconsole()) !==false) print