MediaWiki  master
MediaWiki\Rest\Handler\PageHTMLHandler Class Reference
Inheritance diagram for MediaWiki\Rest\Handler\PageHTMLHandler:
Collaboration diagram for MediaWiki\Rest\Handler\PageHTMLHandler:

Public Member Functions

 __construct (Config $config, PermissionManager $permissionManager, RevisionLookup $revisionLookup, TitleFormatter $titleFormatter, VirtualRESTServiceClient $virtualRESTServiceClient)
 
 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. More...
 
 needsWriteAccess ()
 Indicates whether this route requires write access. More...
 
- Public Member Functions inherited from MediaWiki\Rest\SimpleHandler
 execute ()
 Execute the handler. More...
 
- 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(). More...
 
 checkPreconditions ()
 Check the conditional request headers and generate a response if appropriate. More...
 
 getBodyValidator ( $contentType)
 Fetch the BodyValidator. More...
 
 getConfig ()
 Get the configuration array for the current route. More...
 
 getRequest ()
 Get the current request. More...
 
 getResponseFactory ()
 Get the ResponseFactory which can be used to generate Response objects. More...
 
 getValidatedBody ()
 Fetch the validated body. More...
 
 getValidatedParams ()
 Fetch the validated parameters. More...
 
 init (Router $router, RequestInterface $request, array $config, ResponseFactory $responseFactory, HookContainer $hookContainer)
 Initialise with dependencies from the Router. More...
 
 needsReadAccess ()
 Indicates whether this route requires read rights. More...
 
 validate (Validator $restValidator)
 Validate the request parameters/attributes and body. More...
 

Protected Member Functions

 getETag ()
 Returns an ETag representing a page's source. More...
 
 getLastModified ()
 
- 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. More...
 
 getHookContainer ()
 Get a HookContainer, for running extension hooks or for hook metadata. More...
 
 getHookRunner ()
 Get a HookRunner for running core hooks. More...
 
 getRouter ()
 Get the Router. More...
 
 getRouteUrl ( $pathParams=[], $queryParams=[])
 Get the URL of this handler's endpoint. More...
 
 hasRepresentation ()
 The subclass should override this to indicate whether the resource exists. More...
 
 postInitSetup ()
 The handler can override this to do any necessary setup after init() is called to inject the dependencies. More...
 

Private Member Functions

 constructHtmlUrl ()
 
 fetch200HtmlFromRESTBase (LinkTarget $title)
 
 fetchHtmlFromRESTBase (LinkTarget $title)
 
 getHtmlType ()
 

Private Attributes

array $htmlResponse
 
VirtualRESTServiceClient $restClient
 
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. More...
 
- Protected Attributes inherited from MediaWiki\Rest\Handler\LatestPageContentHandler
Config $config
 
PermissionManager $permissionManager
 
RevisionLookup $revisionLookup
 
TitleFormatter $titleFormatter
 
User $user
 

Detailed Description

Definition at line 34 of file PageHTMLHandler.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Rest\Handler\PageHTMLHandler::__construct ( Config  $config,
PermissionManager  $permissionManager,
RevisionLookup  $revisionLookup,
TitleFormatter  $titleFormatter,
VirtualRESTServiceClient  $virtualRESTServiceClient 
)

Member Function Documentation

◆ constructHtmlUrl()

MediaWiki\Rest\Handler\PageHTMLHandler::constructHtmlUrl ( )
private
Returns
string

Definition at line 117 of file PageHTMLHandler.php.

References wfParseUrl().

Referenced by MediaWiki\Rest\Handler\PageHTMLHandler\run().

◆ fetch200HtmlFromRESTBase()

MediaWiki\Rest\Handler\PageHTMLHandler::fetch200HtmlFromRESTBase ( LinkTarget  $title)
private

◆ fetchHtmlFromRESTBase()

MediaWiki\Rest\Handler\PageHTMLHandler::fetchHtmlFromRESTBase ( LinkTarget  $title)
private

◆ getETag()

MediaWiki\Rest\Handler\PageHTMLHandler::getETag ( )
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.

Returns
string|null
Exceptions
LocalizedHttpException

Reimplemented from MediaWiki\Rest\Handler.

Definition at line 189 of file PageHTMLHandler.php.

References $title, MediaWiki\Rest\Handler\PageHTMLHandler\fetch200HtmlFromRESTBase(), MediaWiki\Rest\Handler\PageHTMLHandler\getHtmlType(), MediaWiki\Rest\Handler\LatestPageContentHandler\getLatestRevision(), and MediaWiki\Rest\Handler\LatestPageContentHandler\getTitle().

◆ getHtmlType()

◆ getLastModified()

◆ run()

Member Data Documentation

◆ $htmlResponse

array MediaWiki\Rest\Handler\PageHTMLHandler::$htmlResponse
private

◆ $restClient

VirtualRESTServiceClient MediaWiki\Rest\Handler\PageHTMLHandler::$restClient
private

Definition at line 38 of file PageHTMLHandler.php.

◆ MAX_AGE_200

const MediaWiki\Rest\Handler\PageHTMLHandler::MAX_AGE_200 = 5
private

Definition at line 35 of file PageHTMLHandler.php.


The documentation for this class was generated from the following file: