MediaWiki REL1_37
PoolWorkArticleView Class Reference

PoolCounter protected work wrapping RenderedRevision->getRevisionParserOutput. More...

Inheritance diagram for PoolWorkArticleView:
Collaboration diagram for PoolWorkArticleView:

Public Member Functions

 __construct (string $workKey, RevisionRecord $revision, ParserOptions $parserOptions, RevisionRenderer $revisionRenderer, LoggerSpi $loggerSpi)
 
 doWork ()
 
 error ( $status)
 
 getError ()
 Get a Status object in case of error or false otherwise.
 
 getIsDirty ()
 Get whether the ParserOutput is a dirty one (i.e.
 
 getIsFastStale ()
 Get whether the ParserOutput was retrieved in fast stale mode.
 
 getParserOutput ()
 Get the ParserOutput from this object, or false in case of failure.
 
- Public Member Functions inherited from PoolCounterWork
 __construct (string $type, string $key, PoolCounter $poolCounter=null)
 
 execute ( $skipcache=false)
 Get the result of the work (whatever it is), or the result of the error() function.
 
 fallback ( $fast)
 A work not so good (eg.
 
 getCachedWork ()
 Retrieve the work from cache.
 
 logError ( $status)
 Log an error.
 

Protected Member Functions

 afterWork (ParserOutput $output)
 Subclasses may implement this to perform some action after the work of rendering is done.
 
 getLogger ( $name='PoolWorkArticleView')
 
 saveInCache (ParserOutput $output, string $cacheTime)
 Place the output in the cache from which getCachedWork() will retrieve it.
 
- Protected Member Functions inherited from PoolCounterWork
 isFastStaleEnabled ()
 Should fast stale mode be used?
 

Protected Attributes

Status bool $error = false
 
bool $isDirty = false
 
bool $isFast = false
 
ParserOptions $parserOptions
 
ParserOutput bool $parserOutput = false
 
RevisionRenderer $renderer = null
 
RevisionRecord null $revision = null
 
- Protected Attributes inherited from PoolCounterWork
bool $cacheable = false
 
string $type = 'generic'
 

Private Attributes

LoggerSpi $loggerSpi
 

Detailed Description

PoolCounter protected work wrapping RenderedRevision->getRevisionParserOutput.

Caching behavior may be defined by subclasses.

Note
No audience checks are applied.
Access: internal

Definition at line 34 of file PoolWorkArticleView.php.

Constructor & Destructor Documentation

◆ __construct()

PoolWorkArticleView::__construct ( string  $workKey,
RevisionRecord  $revision,
ParserOptions  $parserOptions,
RevisionRenderer  $revisionRenderer,
LoggerSpi  $loggerSpi 
)
Parameters
string$workKey
RevisionRecord$revisionRevision to render
ParserOptions$parserOptionsParserOptions to use for the parse
RevisionRenderer$revisionRenderer
LoggerSpi$loggerSpi

Definition at line 67 of file PoolWorkArticleView.php.

Member Function Documentation

◆ afterWork()

PoolWorkArticleView::afterWork ( ParserOutput  $output)
protected

Subclasses may implement this to perform some action after the work of rendering is done.

Will be called after saveInCache().

Parameters
ParserOutput$output

Reimplemented in PoolWorkArticleViewCurrent.

Definition at line 178 of file PoolWorkArticleView.php.

Referenced by doWork().

◆ doWork()

PoolWorkArticleView::doWork ( )
Returns
bool

Reimplemented from PoolCounterWork.

Definition at line 120 of file PoolWorkArticleView.php.

References afterWork(), getLogger(), saveInCache(), and wfTimestampNow().

◆ error()

PoolWorkArticleView::error (   $status)
Parameters
Status$status
Returns
bool

Reimplemented from PoolCounterWork.

Definition at line 186 of file PoolWorkArticleView.php.

References error().

Referenced by error().

◆ getError()

PoolWorkArticleView::getError ( )

Get a Status object in case of error or false otherwise.

Returns
Status|bool

Definition at line 113 of file PoolWorkArticleView.php.

◆ getIsDirty()

PoolWorkArticleView::getIsDirty ( )

Get whether the ParserOutput is a dirty one (i.e.

expired)

Returns
bool

Definition at line 95 of file PoolWorkArticleView.php.

◆ getIsFastStale()

PoolWorkArticleView::getIsFastStale ( )

Get whether the ParserOutput was retrieved in fast stale mode.

Returns
bool

Definition at line 104 of file PoolWorkArticleView.php.

◆ getLogger()

PoolWorkArticleView::getLogger (   $name = 'PoolWorkArticleView')
protected
Parameters
string$name
Returns
LoggerInterface

Definition at line 196 of file PoolWorkArticleView.php.

References getLogger().

Referenced by doWork(), PoolWorkArticleViewCurrent\fallback(), PoolWorkArticleViewCurrent\getCachedWork(), and getLogger().

◆ getParserOutput()

PoolWorkArticleView::getParserOutput ( )

Get the ParserOutput from this object, or false in case of failure.

Returns
ParserOutput|bool

Definition at line 86 of file PoolWorkArticleView.php.

◆ saveInCache()

PoolWorkArticleView::saveInCache ( ParserOutput  $output,
string  $cacheTime 
)
protected

Place the output in the cache from which getCachedWork() will retrieve it.

Will be called before saveInCache().

Parameters
ParserOutput$output
string$cacheTime

Reimplemented in PoolWorkArticleViewCurrent, and PoolWorkArticleViewOld.

Definition at line 168 of file PoolWorkArticleView.php.

Referenced by doWork().

Member Data Documentation

◆ $error

Status bool PoolWorkArticleView::$error = false
protected

Definition at line 55 of file PoolWorkArticleView.php.

◆ $isDirty

bool PoolWorkArticleView::$isDirty = false
protected

Definition at line 49 of file PoolWorkArticleView.php.

◆ $isFast

bool PoolWorkArticleView::$isFast = false
protected

Definition at line 52 of file PoolWorkArticleView.php.

◆ $loggerSpi

LoggerSpi PoolWorkArticleView::$loggerSpi
private

Definition at line 58 of file PoolWorkArticleView.php.

◆ $parserOptions

ParserOptions PoolWorkArticleView::$parserOptions
protected

Definition at line 37 of file PoolWorkArticleView.php.

◆ $parserOutput

ParserOutput bool PoolWorkArticleView::$parserOutput = false
protected

Definition at line 46 of file PoolWorkArticleView.php.

◆ $renderer

RevisionRenderer PoolWorkArticleView::$renderer = null
protected

Definition at line 43 of file PoolWorkArticleView.php.

◆ $revision

RevisionRecord null PoolWorkArticleView::$revision = null
protected

Definition at line 40 of file PoolWorkArticleView.php.


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