MediaWiki  master
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. More...
 
 getIsDirty ()
 Get whether the ParserOutput is a dirty one (i.e. More...
 
 getIsFastStale ()
 Get whether the ParserOutput was retrieved in fast stale mode. More...
 
 getParserOutput ()
 Get the ParserOutput from this object, or false in case of failure. More...
 
- 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. More...
 
 fallback ( $fast)
 A work not so good (eg. More...
 
 getCachedWork ()
 Retrieve the work from cache. More...
 
 logError ( $status)
 Log an error. More...
 

Protected Member Functions

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

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.

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.

References $loggerSpi, $parserOptions, and $revision.

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.

◆ 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.

References $error.

◆ getIsDirty()

PoolWorkArticleView::getIsDirty ( )

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

expired)

Returns
bool

Definition at line 95 of file PoolWorkArticleView.php.

References $isDirty.

◆ getIsFastStale()

PoolWorkArticleView::getIsFastStale ( )

Get whether the ParserOutput was retrieved in fast stale mode.

Returns
bool

Definition at line 104 of file PoolWorkArticleView.php.

References $isFast.

◆ getLogger()

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

Definition at line 196 of file PoolWorkArticleView.php.

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

◆ 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.

References $parserOutput.

◆ 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 PoolWorkArticleViewOld, and PoolWorkArticleViewCurrent.

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.

Referenced by getError().

◆ $isDirty

bool PoolWorkArticleView::$isDirty = false
protected

Definition at line 49 of file PoolWorkArticleView.php.

Referenced by getIsDirty().

◆ $isFast

bool PoolWorkArticleView::$isFast = false
protected

Definition at line 52 of file PoolWorkArticleView.php.

Referenced by getIsFastStale().

◆ $loggerSpi

LoggerSpi PoolWorkArticleView::$loggerSpi
private

◆ $parserOptions

ParserOptions PoolWorkArticleView::$parserOptions
protected

◆ $parserOutput

ParserOutput bool PoolWorkArticleView::$parserOutput = false
protected

◆ $renderer

RevisionRenderer PoolWorkArticleView::$renderer = null
protected

Definition at line 43 of file PoolWorkArticleView.php.

◆ $revision

RevisionRecord null PoolWorkArticleView::$revision = null
protected

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