MediaWiki REL1_39
MediaWiki\Page\ParserOutputAccess Class Reference

Service for getting rendered output of a given page. More...

Public Member Functions

 __construct (ParserCache $primaryCache, RevisionOutputCache $secondaryCache, RevisionLookup $revisionLookup, RevisionRenderer $revisionRenderer, IBufferingStatsdDataFactory $statsDataFactory, ILBFactory $lbFactory, LoggerSpi $loggerSpi, WikiPageFactory $wikiPageFactory, TitleFormatter $titleFormatter)
 
 getCachedParserOutput (PageRecord $page, ParserOptions $parserOptions, ?RevisionRecord $revision=null, int $options=0)
 Returns the rendered output for the given page if it is present in the cache.
 
 getParserOutput (PageRecord $page, ParserOptions $parserOptions, ?RevisionRecord $revision=null, int $options=0)
 Returns the rendered output for the given page.
 

Detailed Description

Service for getting rendered output of a given page.

This is a high level service, encapsulating concerns like caching and stampede protection via PoolCounter.

Since
1.36

Definition at line 50 of file ParserOutputAccess.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Page\ParserOutputAccess::__construct ( ParserCache $primaryCache,
RevisionOutputCache $secondaryCache,
RevisionLookup $revisionLookup,
RevisionRenderer $revisionRenderer,
IBufferingStatsdDataFactory $statsDataFactory,
ILBFactory $lbFactory,
LoggerSpi $loggerSpi,
WikiPageFactory $wikiPageFactory,
TitleFormatter $titleFormatter )
Parameters
ParserCache$primaryCache
RevisionOutputCache$secondaryCache
RevisionLookup$revisionLookup
RevisionRenderer$revisionRenderer
IBufferingStatsdDataFactory$statsDataFactory
ILBFactory$lbFactory
LoggerSpi$loggerSpi
WikiPageFactory$wikiPageFactory
TitleFormatter$titleFormatter

Definition at line 134 of file ParserOutputAccess.php.

Member Function Documentation

◆ getCachedParserOutput()

MediaWiki\Page\ParserOutputAccess::getCachedParserOutput ( PageRecord $page,
ParserOptions $parserOptions,
?RevisionRecord $revision = null,
int $options = 0 )

Returns the rendered output for the given page if it is present in the cache.

Parameters
PageRecord$page
ParserOptions$parserOptions
RevisionRecord | null$revision
int$optionsBitfield using the OPT_XXX constants
Returns
ParserOutput|null

Definition at line 205 of file ParserOutputAccess.php.

◆ getParserOutput()

MediaWiki\Page\ParserOutputAccess::getParserOutput ( PageRecord $page,
ParserOptions $parserOptions,
?RevisionRecord $revision = null,
int $options = 0 )

Returns the rendered output for the given page.

Caching and concurrency control is applied.

Parameters
PageRecord$page
ParserOptions$parserOptions
RevisionRecord | null$revision
int$optionsBitfield using the OPT_XXX constants
Returns
Status containing a ParserOutput if no error occurred. Well known errors and warnings include the following messages:
  • 'view-pool-dirty-output' (warning) The output is dirty (from a stale cache entry).
  • 'view-pool-contention' (warning) Dirty output was returned immediately instead of waiting to acquire a work lock (when "fast stale" mode is enabled in PoolCounter).
  • 'view-pool-timeout' (warning) Dirty output was returned after failing to acquire a work lock (got QUEUE_FULL or TIMEOUT from PoolCounter).
  • 'pool-queuefull' (error) unable to acquire work lock, and no cached content found.
  • 'pool-timeout' (error) unable to acquire work lock, and no cached content found.
  • 'pool-servererror' (error) PoolCounterWork failed due to a lock service error.
  • 'pool-unknownerror' (error) PoolCounterWork failed for an unknown reason.
  • 'nopagetext' (error) The page does not exist

Definition at line 261 of file ParserOutputAccess.php.


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