|
MediaWiki master
|
Inherits MediaWiki\Rest\Handler\Helper\HtmlOutputHelper.

Public Member Functions | |||||||
| __construct (private ShadowPageLoader $shadowPageLoader, private TitleFormatter $titleFormatter, private SiteConfig $siteConfig, private ParserOptions $parserOptions, PageIdentity $page) | |||||||
| getETag (string $suffix='') | |||||||
Returns an ETag uniquely identifying the HTML output.
| |||||||
| 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.
| |||||||
| getLastModified () | |||||||
Returns the time at which the HTML was rendered.
| |||||||
| getPageBundle () | |||||||
Fetch the rendering of a given page as a full-document HtmlPageBundle.Unlike getHtml() (whose ParserOutput carries body-only content), the returned bundle always carries the full document (<html><head>…</head> <body>…</body></html>). Use this when emitting a full document to a client.
| |||||||
| 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.
| |||||||
Static Public Member Functions | |
| static | getParamSettings () |
Gets the request parameters of this request.
| |
| MediaWiki\Rest\Handler\Helper\HtmlShadowOutputHelper::__construct | ( | private ShadowPageLoader | $shadowPageLoader, |
| private TitleFormatter | $titleFormatter, | ||
| private SiteConfig | $siteConfig, | ||
| private ParserOptions | $parserOptions, | ||
| PageIdentity | $page ) |
Definition at line 29 of file HtmlShadowOutputHelper.php.
| MediaWiki\Rest\Handler\Helper\HtmlShadowOutputHelper::getETag | ( | string | $suffix = '' | ) |
Returns an ETag uniquely identifying the HTML output.
| string | $suffix | A suffix to attach to the etag. Must consist of characters that are legal in ETags. |
Implements MediaWiki\Rest\Handler\Helper\HtmlOutputHelper.
Definition at line 83 of file HtmlShadowOutputHelper.php.
| MediaWiki\Rest\Handler\Helper\HtmlShadowOutputHelper::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.
| LocalizedHttpException | |
| ClientError |
Implements MediaWiki\Rest\Handler\Helper\HtmlOutputHelper.
Definition at line 42 of file HtmlShadowOutputHelper.php.
| MediaWiki\Rest\Handler\Helper\HtmlShadowOutputHelper::getLastModified | ( | ) |
Returns the time at which the HTML was rendered.
Implements MediaWiki\Rest\Handler\Helper\HtmlOutputHelper.
Definition at line 99 of file HtmlShadowOutputHelper.php.
| MediaWiki\Rest\Handler\Helper\HtmlShadowOutputHelper::getPageBundle | ( | ) |
Fetch the rendering of a given page as a full-document HtmlPageBundle.Unlike getHtml() (whose ParserOutput carries body-only content), the returned bundle always carries the full document (<html><head>…</head> <body>…</body></html>). Use this when emitting a full document to a client.
| LocalizedHttpException | |
| ClientError |
Builds the full document directly as a page bundle: the body fragment from the shadow page wrapped in a document with an injected content-language <meta> in the <head>. (getHtml()'s ParserOutput stays body-only, per the ContentHolder invariant.)
Implements MediaWiki\Rest\Handler\Helper\HtmlOutputHelper.
Definition at line 74 of file HtmlShadowOutputHelper.php.
|
static |
Gets the request parameters of this request.
Implements MediaWiki\Rest\Handler\Helper\HtmlOutputHelper.
Definition at line 106 of file HtmlShadowOutputHelper.php.
| MediaWiki\Rest\Handler\Helper\HtmlShadowOutputHelper::putHeaders | ( | ResponseInterface | $response, |
| bool | $forHtml = true ) |
Set the HTTP headers based on the response generated.
| ResponseInterface | $response | |
| bool | $forHtml | Whether the response will be HTML (rather than JSON) |
Implements MediaWiki\Rest\Handler\Helper\HtmlOutputHelper.
Definition at line 120 of file HtmlShadowOutputHelper.php.
| MediaWiki\Rest\Handler\Helper\HtmlShadowOutputHelper::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.
| Bcp47Code | string | $targetLanguage | |
| Bcp47Code | string | null | $sourceLanguage |
Implements MediaWiki\Rest\Handler\Helper\HtmlOutputHelper.
Definition at line 113 of file HtmlShadowOutputHelper.php.