MediaWiki master
MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper Class Reference

Inherits MediaWiki\Rest\Handler\Helper\HtmlOutputHelper.

Collaboration diagram for MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper:

Public Member Functions

 __construct (?PageIdentity $page=null)
 
 getETag (string $suffix='')
 Returns an ETag uniquely identifying the HTML output.
See also
Handler::getETag()
Parameters
string$suffixA suffix to attach to the etag. Must consist of characters that are legal in ETags.
Returns
string|null We return null when there is no etag.

 
 getHtml ()
 Fetch the HTML for rendering of a given page.If the rendering is available in parsoid parser cache, return that. Otherwise, perform a parse and return the result while caching it in the parser cache.NOTE: Caching can be explicitly disabled or a force parse action can be issued. Stashing and rate limiting on stashing also applies here if specified.
Returns
ParserOutput a tuple with html and content-type
Exceptions
LocalizedHttpException
ClientError

 
 getLastModified ()
 Returns the time at which the HTML was rendered.
See also
Handler::getLastModified()
Returns
string|null

 
 init (PageIdentity $page)
 Initializes the helper with the given parameters like the page we're dealing with.
 
 putHeaders (ResponseInterface $response, bool $forHtml=true)
 Set the HTTP headers based on the response generated.
 
 setVariantConversionLanguage ( $targetLanguage, $sourceLanguage=null)
 Set the language to be used for variant conversion.If $targetLanguage is a string, it may be a list of language ranges as specified by RFC 9110 for use in the Accept-Language header. Implementations must be able to process this format, and may use the information provided to choose a supported target language that is desirable to the client.
Parameters
Bcp47Code | string$targetLanguage
Bcp47Code | string | null$sourceLanguage

 

Static Public Member Functions

static getParamSettings ()
 Gets the request parameters of this request.
See also
Handler::getParamSettings()
Returns
array

 

Detailed Description

Since
1.40
Stability: unstable

Definition at line 35 of file HtmlMessageOutputHelper.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper::__construct ( ?PageIdentity $page = null)
Note
Since 1.43 setting $page to null has been deprecated.

Definition at line 42 of file HtmlMessageOutputHelper.php.

References wfDeprecated().

Member Function Documentation

◆ getETag()

MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper::getETag ( string $suffix = '')

Returns an ETag uniquely identifying the HTML output.

See also
Handler::getETag()
Parameters
string$suffixA suffix to attach to the etag. Must consist of characters that are legal in ETags.
Returns
string|null We return null when there is no etag.

Implements MediaWiki\Rest\Handler\Helper\HtmlOutputHelper.

Definition at line 92 of file HtmlMessageOutputHelper.php.

◆ getHtml()

MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper::getHtml ( )

Fetch the HTML for rendering of a given page.If the rendering is available in parsoid parser cache, return that. Otherwise, perform a parse and return the result while caching it in the parser cache.NOTE: Caching can be explicitly disabled or a force parse action can be issued. Stashing and rate limiting on stashing also applies here if specified.

Returns
ParserOutput a tuple with html and content-type
Exceptions
LocalizedHttpException
ClientError

Implements MediaWiki\Rest\Handler\Helper\HtmlOutputHelper.

Definition at line 73 of file HtmlMessageOutputHelper.php.

◆ getLastModified()

MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper::getLastModified ( )

Returns the time at which the HTML was rendered.

See also
Handler::getLastModified()
Returns
string|null

Note
This is guaranteed to always return NULL since proper system messages (with no DB entry) have no revision, so they should have no last modified time.

Implements MediaWiki\Rest\Handler\Helper\HtmlOutputHelper.

Definition at line 107 of file HtmlMessageOutputHelper.php.

◆ getParamSettings()

static MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper::getParamSettings ( )
static

Gets the request parameters of this request.

See also
Handler::getParamSettings()
Returns
array

Implements MediaWiki\Rest\Handler\Helper\HtmlOutputHelper.

Definition at line 114 of file HtmlMessageOutputHelper.php.

◆ init()

MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper::init ( PageIdentity $page)

Initializes the helper with the given parameters like the page we're dealing with.

Parameters
PageIdentity$page
Deprecated
since 1.43, use constructor argument instead

Definition at line 56 of file HtmlMessageOutputHelper.php.

◆ putHeaders()

MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper::putHeaders ( ResponseInterface $response,
bool $forHtml = true )

Set the HTTP headers based on the response generated.

Parameters
ResponseInterface$response
bool$forHtmlWhether the response will be HTML (rather than JSON)
Returns
void

Implements MediaWiki\Rest\Handler\Helper\HtmlOutputHelper.

Definition at line 128 of file HtmlMessageOutputHelper.php.

◆ setVariantConversionLanguage()

MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper::setVariantConversionLanguage ( $targetLanguage,
$sourceLanguage = null )

Set the language to be used for variant conversion.If $targetLanguage is a string, it may be a list of language ranges as specified by RFC 9110 for use in the Accept-Language header. Implementations must be able to process this format, and may use the information provided to choose a supported target language that is desirable to the client.

Parameters
Bcp47Code | string$targetLanguage
Bcp47Code | string | null$sourceLanguage

Implements MediaWiki\Rest\Handler\Helper\HtmlOutputHelper.

Definition at line 121 of file HtmlMessageOutputHelper.php.


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