MediaWiki
1.30.0
|
Request handler implementing a data interface for mediawiki pages. More...
Public Member Functions | |
canHandleRequest ( $subPage, WebRequest $request) | |
Checks whether the request is complete, i.e. More... | |
handleRequest ( $subPage, WebRequest $request, OutputPage $output) | |
Main method for handling requests. More... | |
httpContentNegotiation (WebRequest $request, OutputPage $output, Title $title, $revision=0) | |
Applies HTTP content negotiation. More... | |
Private Member Functions | |
getDocUrl (Title $title, $format='', $revision=0) | |
Returns a url representing the given title. More... | |
Request handler implementing a data interface for mediawiki pages.
Definition at line 14 of file PageDataRequestHandler.php.
PageDataRequestHandler::canHandleRequest | ( | $subPage, | |
WebRequest | $request | ||
) |
Checks whether the request is complete, i.e.
whether it contains all information needed to reply with page data.
This does not check whether the request is valid and will actually produce a successful response.
string | null | $subPage | |
WebRequest | $request |
HttpError |
Definition at line 29 of file PageDataRequestHandler.php.
References $request.
Referenced by handleRequest().
|
private |
Returns a url representing the given title.
Title | $title | |
string | null | $format | The (normalized) format name, or '' |
int | $revision |
Definition at line 156 of file PageDataRequestHandler.php.
References $params, and $title.
Referenced by httpContentNegotiation().
PageDataRequestHandler::handleRequest | ( | $subPage, | |
WebRequest | $request, | ||
OutputPage | $output | ||
) |
Main method for handling requests.
string | $subPage | |
WebRequest | $request | The request parameters. Known parameters are:
|
OutputPage | $output |
HttpError |
Definition at line 64 of file PageDataRequestHandler.php.
References $output, $request, $title, canHandleRequest(), httpContentNegotiation(), Title\newFromTextThrow(), and wfMessage().
PageDataRequestHandler::httpContentNegotiation | ( | WebRequest | $request, |
OutputPage | $output, | ||
Title | $title, | ||
$revision = 0 |
|||
) |
Applies HTTP content negotiation.
If the negotiation is successful, this method will set the appropriate redirect in the OutputPage object and return. Otherwise, an HttpError is thrown.
WebRequest | $request | |
OutputPage | $output | |
Title | $title | |
int | $revision | The desired revision |
HttpError |
Definition at line 110 of file PageDataRequestHandler.php.
References $output, $parser, $request, $title, getDocUrl(), ContentHandler\getForTitle(), and wfMessage().
Referenced by handleRequest().