|
MediaWiki master
|
Service for getting rendered output of a given page. More...
Inherits LoggerAwareInterface.

Public Member Functions | |
| __construct (private readonly Config $config, private readonly OutputTransformPipeline $outputTransformPipeline, ParserCacheFactory $parserCacheFactory, RevisionLookup $revisionLookup, RevisionRenderer $revisionRenderer, StatsFactory $statsFactory, ChronologyProtector $chronologyProtector, WikiPageFactory $wikiPageFactory, TitleFormatter $titleFormatter, TracerInterface $tracer, PoolCounterFactory $poolCounterFactory) | |
| clearLocalCache () | |
| Clear the local cache. | |
| getCachedParserOutput (PageRecord $page, ParserOptions $parserOptions, ?RevisionRecord $revision=null, $options=[]) | |
| Get the rendered output for the given page if it is present in the cache. | |
| getParserOutput (PageRecord $page, ParserOptions $parserOptions, ?RevisionRecord $revision=null, $options=[]) | |
| Returns the rendered output for the given page. | |
| postprocess (ParserOutput $output, ParserOptions $parserOptions, PageRecord $page, ?RevisionRecord $revision=null) | |
| Postprocess the given ParserOutput. | |
| setLogger (LoggerInterface $logger) | |
Static Public Member Functions | |
| static | postprocessInPipeline (OutputTransformPipeline $outputTransformPipeline, ParserOutput $output, ParserOptions $parserOptions, PageRecord $page, callable $getCacheKey) |
| Postprocess the given ParserOutput in the given pipeline. | |
Public Attributes | |
| const | OPT_FOR_ARTICLE_VIEW = 16 |
| Apply page view semantics. | |
| const | OPT_POOL_COUNTER = 'poolcounter-type' |
| const | OPT_POOL_COUNTER_FALLBACK = 'poolcounter-fallback' |
| Whether to fall back to using stale content when failing to get a poolcounter lock. | |
| const | PARSOID_PCACHE_NAME = 'parsoid-' . ParserCacheFactory::DEFAULT_NAME |
| const | PARSOID_RCACHE_NAME = 'parsoid-' . ParserCacheFactory::DEFAULT_RCACHE_NAME |
| const | POOL_COUNTER_ARTICLE_VIEW = 'ArticleView' |
| const | POOL_COUNTER_REST_API = 'HtmlRestApi' |
| const | POSTPROC_CACHE_PREFIX = 'postproc-' |
Protected Member Functions | |
| newPoolWork (PageRecord $page, ParserOptions $parserOptions, RevisionRecord $revision, array $options) | |
Service for getting rendered output of a given page.
This is a high level service, encapsulating concerns like caching and stampede protection via PoolCounter.
Definition at line 47 of file ParserOutputAccess.php.
| MediaWiki\Page\ParserOutputAccess::__construct | ( | private readonly Config | $config, |
| private readonly OutputTransformPipeline | $outputTransformPipeline, | ||
| ParserCacheFactory | $parserCacheFactory, | ||
| RevisionLookup | $revisionLookup, | ||
| RevisionRenderer | $revisionRenderer, | ||
| StatsFactory | $statsFactory, | ||
| ChronologyProtector | $chronologyProtector, | ||
| WikiPageFactory | $wikiPageFactory, | ||
| TitleFormatter | $titleFormatter, | ||
| TracerInterface | $tracer, | ||
| PoolCounterFactory | $poolCounterFactory ) |
Definition at line 174 of file ParserOutputAccess.php.
| MediaWiki\Page\ParserOutputAccess::clearLocalCache | ( | ) |
| MediaWiki\Page\ParserOutputAccess::getCachedParserOutput | ( | PageRecord | $page, |
| ParserOptions | $parserOptions, | ||
| ?RevisionRecord | $revision = null, | ||
| $options = [] ) |
Get the rendered output for the given page if it is present in the cache.
| PageRecord | $page | |
| ParserOptions | $parserOptions | |
| RevisionRecord | null | $revision | |
| int | array | $options | Bitfield or associative array using the OPT_XXX constants. Passing an int is deprecated and will trigger deprecation warnings in the future. |
Definition at line 305 of file ParserOutputAccess.php.
| MediaWiki\Page\ParserOutputAccess::getParserOutput | ( | PageRecord | $page, |
| ParserOptions | $parserOptions, | ||
| ?RevisionRecord | $revision = null, | ||
| $options = [] ) |
Returns the rendered output for the given page.
Caching and concurrency control is applied.
| PageRecord | $page | |
| ParserOptions | $parserOptions | |
| RevisionRecord | null | $revision | |
| int | array | $options | Bitfield or associative array using the OPT_XXX constants. Passing an int is deprecated and will trigger deprecation warnings in the future. |
Definition at line 440 of file ParserOutputAccess.php.
|
protected |
Definition at line 673 of file ParserOutputAccess.php.
| MediaWiki\Page\ParserOutputAccess::postprocess | ( | ParserOutput | $output, |
| ParserOptions | $parserOptions, | ||
| PageRecord | $page, | ||
| ?RevisionRecord | $revision = null ) |
Postprocess the given ParserOutput.
Definition at line 825 of file ParserOutputAccess.php.
|
static |
Postprocess the given ParserOutput in the given pipeline.
If debugging information is requested in the parser options, $getCache will be used to obtain an appropriate ParserCache in order to include the cache key in the debugging output.
| OutputTransformPipeline | $outputTransformPipeline | |
| ParserOutput | $output | |
| ParserOptions | $parserOptions | |
| PageRecord | $page | |
| callable(array):(string|null) | $getCacheKey a function to return the cache key used, given an array of used parser options; null indicates that the postprocessed output will not be cached |
Definition at line 861 of file ParserOutputAccess.php.
References MediaWiki\Parser\ParserOptions\getOption().
| MediaWiki\Page\ParserOutputAccess::setLogger | ( | LoggerInterface | $logger | ) |
Definition at line 201 of file ParserOutputAccess.php.
| const MediaWiki\Page\ParserOutputAccess::OPT_FOR_ARTICLE_VIEW = 16 |
Apply page view semantics.
This relaxes some guarantees, specifically:
Definition at line 104 of file ParserOutputAccess.php.
| const MediaWiki\Page\ParserOutputAccess::OPT_POOL_COUNTER = 'poolcounter-type' |
Definition at line 126 of file ParserOutputAccess.php.
| const MediaWiki\Page\ParserOutputAccess::OPT_POOL_COUNTER_FALLBACK = 'poolcounter-fallback' |
Whether to fall back to using stale content when failing to get a poolcounter lock.
Definition at line 121 of file ParserOutputAccess.php.
| const MediaWiki\Page\ParserOutputAccess::PARSOID_PCACHE_NAME = 'parsoid-' . ParserCacheFactory::DEFAULT_NAME |
Definition at line 50 of file ParserOutputAccess.php.
| const MediaWiki\Page\ParserOutputAccess::PARSOID_RCACHE_NAME = 'parsoid-' . ParserCacheFactory::DEFAULT_RCACHE_NAME |
Definition at line 53 of file ParserOutputAccess.php.
| const MediaWiki\Page\ParserOutputAccess::POOL_COUNTER_ARTICLE_VIEW = 'ArticleView' |
Definition at line 131 of file ParserOutputAccess.php.
| const MediaWiki\Page\ParserOutputAccess::POOL_COUNTER_REST_API = 'HtmlRestApi' |
Definition at line 136 of file ParserOutputAccess.php.
| const MediaWiki\Page\ParserOutputAccess::POSTPROC_CACHE_PREFIX = 'postproc-' |
Definition at line 56 of file ParserOutputAccess.php.