85 HttpStatus::header( $this->httpCode );
86 header(
'Content-type: text/html; charset=utf-8' );
92 $logger = LoggerFactory::getInstance(
'HttpError' );
101 'line' => $this->getLine(),
105 $logMsg =
"$content ({http_code}) from {file}:{line}";
108 $logger->info( $logMsg, $context );
110 $logger->error( $logMsg, $context );
121 if ( $this->
header ===
null ) {
122 $titleHtml = htmlspecialchars( HttpStatus::getMessage( $this->httpCode ) );
124 $titleHtml = $this->
header->escaped();
126 $titleHtml = htmlspecialchars( $this->
header );
129 if ( $this->content instanceof
Message ) {
130 $contentHtml = $this->content->escaped();
132 $contentHtml = nl2br( htmlspecialchars( $this->content ) );
135 return "<!DOCTYPE html>\n" .
136 "<html><head><title>$titleHtml</title></head>\n" .
137 "<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.
string Message null $header
report()
Report and log the HTTP error.
getStatusCode()
Returns the HTTP status code supplied to the constructor.
__construct( $httpCode, $content, $header=null)
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.
text()
Returns the message text.
while(( $__line=Maintenance::readconsole()) !==false) print