Go to the documentation of this file.
45 if ( $subPage ===
'' || $subPage ===
null ) {
46 return $request->
getText(
'target' ) !==
'';
49 $parts = explode(
'/', $subPage, 2 );
52 return ( $slot ===
'main' || $slot ===
'' ) &&
$title !==
'';
72 $output->getRequest()->response()->header(
'Access-Control-Allow-Origin: *' );
80 if ( $subPage !==
'' ) {
81 $parts = explode(
'/', $subPage, 2 );
87 $revision = $request->
getInt(
'oldid', $revision );
88 $revision = $request->
getInt(
'revision', $revision );
123 $mimeTypes = $contentHandler->getSupportedFormats();
125 $acceptHeader = $request->
getHeader(
'Accept' );
126 if ( $acceptHeader !==
false ) {
128 $accept = $parser->parseWeights( $acceptHeader );
135 $accept[$mimeTypes[0]] = 1;
139 $format = $negotiator->getBestSupportedKey( $accept );
141 if ( $format ===
null ) {
142 $format = isset( $accept[
'text/html'] ) ?
'text/html' :
null;
145 if ( $format ===
null ) {
146 $msg =
wfMessage(
'pagedata-not-acceptable', implode(
', ', $mimeTypes ) );
150 $url = $this->
getDocUrl( $title, $format, $revision );
151 $output->redirect( $url, 303 );
165 if ( $revision > 0 ) {
166 $params[
'oldid'] = $revision;
169 if ( $format ===
'text/html' ) {
170 return $title->getFullURL( $params );
173 $params[
'action' ] =
'raw';
175 return $title->getFullURL( $params );
Request handler implementing a data interface for mediawiki pages.
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
static getForTitle(Title $title)
Returns the appropriate ContentHandler singleton for the given title.
Show an error that looks like an HTTP server error.
getText( $name, $default='')
Fetch a text string from the given array or return $default if it's not set.
getDocUrl(Title $title, $format='', $revision=0)
Returns a url representing the given title.
httpContentNegotiation(WebRequest $request, OutputPage $output, Title $title, $revision=0)
Applies HTTP content negotiation.
static newFromTextThrow( $text, $defaultNamespace=NS_MAIN)
Like Title::newFromText(), but throws MalformedTitleException when the title is invalid,...
The WebRequest class encapsulates getting at data passed in the URL or via a POSTed form stripping il...
Represents a title within MediaWiki.
handleRequest( $subPage, WebRequest $request, OutputPage $output)
Main method for handling requests.
getInt( $name, $default=0)
Fetch an integer value from the input or return $default if not set.
getHeader( $name, $flags=0)
Get a request header, or false if it isn't set.
canHandleRequest( $subPage, WebRequest $request)
Checks whether the request is complete, i.e.