when calling a non-existent wiki page mediawiki delievers a 404 in the header.
Is there a way to catch this from the own page (for logging reasons)?
There is a
public function getStatusCode()
in WebResponse.php and in HttpError.php
and in OutputPage.php e.g. there is a
public function setStatusCode( $statusCode )
From within the MonoBookTemplate.php i have an instance of MonoBookTemplate.
But how do i catch from this place the 404 status?
I read about $context->getOutput()
but have no clue how to access the status variable.
Part-Solution:
As a workaround i added $wgMyStatusCode
to the LocalSettings.php
and in WebResponse.php
:
public function statusHeader( $code ) {
HttpStatus::header( $code );
//added
global $wgMyStatusCode;
$wgMyStatusCode = $code;
}
Anyway - if someone could me introduce to the secrets of object-orientation in mediawiki - thanks.