MediaWiki REL1_35
|
Handler class for Core REST API Page Source endpoint. More...
Public Member Functions | |
run (string $title) | |
Public Member Functions inherited from MediaWiki\Rest\Handler\LatestPageContentHandler | |
__construct (Config $config, PermissionManager $permissionManager, RevisionLookup $revisionLookup, TitleFormatter $titleFormatter) | |
getParamSettings () | |
Fetch ParamValidator settings for parameters. | |
needsWriteAccess () | |
Indicates whether this route requires write access. | |
Public Member Functions inherited from MediaWiki\Rest\SimpleHandler | |
execute () | |
Execute the handler. | |
Public Member Functions inherited from MediaWiki\Rest\Handler | |
applyConditionalResponseHeaders (ResponseInterface $response) | |
Modify the response, adding Last-Modified and ETag headers as indicated the values previously returned by ETag and getLastModified(). | |
checkPreconditions () | |
Check the conditional request headers and generate a response if appropriate. | |
getBodyValidator ( $contentType) | |
Fetch the BodyValidator. | |
getConfig () | |
Get the configuration array for the current route. | |
getRequest () | |
Get the current request. | |
getResponseFactory () | |
Get the ResponseFactory which can be used to generate Response objects. | |
getValidatedBody () | |
Fetch the validated body. | |
getValidatedParams () | |
Fetch the validated parameters. | |
init (Router $router, RequestInterface $request, array $config, ResponseFactory $responseFactory, HookContainer $hookContainer) | |
Initialise with dependencies from the Router. | |
needsReadAccess () | |
Indicates whether this route requires read rights. | |
validate (Validator $restValidator) | |
Validate the request parameters/attributes and body. | |
Protected Member Functions | |
getETag () | |
Returns an ETag representing a page's source. | |
getLastModified () | |
getPageContent (string $slotRole, RevisionRecord $revision) | |
Protected Member Functions inherited from MediaWiki\Rest\Handler\LatestPageContentHandler | |
constructMetadata (Title $titleObject, RevisionRecord $revision) | |
getLatestRevision () | |
getTitle () | |
isAccessible ( $titleObject) | |
Protected Member Functions inherited from MediaWiki\Rest\Handler | |
getConditionalHeaderUtil () | |
Get a ConditionalHeaderUtil object. | |
getHookContainer () | |
Get a HookContainer, for running extension hooks or for hook metadata. | |
getHookRunner () | |
Get a HookRunner for running core hooks. | |
getRouter () | |
Get the Router. | |
getRouteUrl ( $pathParams=[], $queryParams=[]) | |
Get the URL of this handler's endpoint. | |
hasRepresentation () | |
The subclass should override this to indicate whether the resource exists. | |
postInitSetup () | |
The handler can override this to do any necessary setup after init() is called to inject the dependencies. | |
urlEncodeTitle ( $title) | |
URL-encode titles in a "pretty" way. | |
Private Member Functions | |
getRole () | |
Private Attributes | |
const | MAX_AGE_200 = 5 |
Additional Inherited Members | |
Public Attributes inherited from MediaWiki\Rest\Handler | |
const | PARAM_SOURCE = 'rest-param-source' |
(string) ParamValidator constant to specify the source of the parameter. | |
Protected Attributes inherited from MediaWiki\Rest\Handler\LatestPageContentHandler | |
Config | $config |
PermissionManager | $permissionManager |
RevisionLookup | $revisionLookup |
TitleFormatter | $titleFormatter |
User | $user |
Handler class for Core REST API Page Source endpoint.
Definition at line 17 of file PageSourceHandler.php.
|
protected |
Returns an ETag representing a page's source.
The ETag assumes a page's source has changed if the latest revision of a page has been made private, un-readable for another reason, or a newer revision exists.
Reimplemented from MediaWiki\Rest\Handler.
Definition at line 95 of file PageSourceHandler.php.
|
protected |
Reimplemented from MediaWiki\Rest\Handler.
Definition at line 109 of file PageSourceHandler.php.
References MediaWiki\Revision\RevisionRecord\getTimestamp().
|
protected |
string | $slotRole | |
RevisionRecord | $revision |
LocalizedHttpException | slot content is not TextContent or Revision/Slot is inaccessible |
Definition at line 31 of file PageSourceHandler.php.
|
private |
Definition at line 21 of file PageSourceHandler.php.
MediaWiki\Rest\Handler\PageSourceHandler::run | ( | string | $title | ) |
string | $title |
LocalizedHttpException |
Definition at line 59 of file PageSourceHandler.php.
References $title.
|
private |
Definition at line 18 of file PageSourceHandler.php.