MediaWiki  master
PoolWorkArticleViewOld.php
Go to the documentation of this file.
1 <?php
20 use MediaWiki\Logger\Spi as LoggerSpi;
24 
31 
33  private $cache;
34 
43  public function __construct(
44  string $workKey,
48  RevisionRenderer $revisionRenderer,
49  LoggerSpi $loggerSpi
50  ) {
51  parent::__construct( $workKey, $revision, $parserOptions, $revisionRenderer, $loggerSpi );
52 
53  $this->cache = $cache;
54 
55  $this->cacheable = true;
56  }
57 
62  protected function saveInCache( ParserOutput $output, string $cacheTime ) {
63  $this->cache->save( $output, $this->revision, $this->parserOptions, $cacheTime );
64  }
65 
69  public function getCachedWork() {
70  $this->parserOutput = $this->cache->get( $this->revision, $this->parserOptions );
71 
72  return (bool)$this->parserOutput;
73  }
74 
75 }
PoolWorkArticleViewOld\saveInCache
saveInCache(ParserOutput $output, string $cacheTime)
Definition: PoolWorkArticleViewOld.php:62
ParserOptions
Set options of the Parser.
Definition: ParserOptions.php:45
MediaWiki\Revision\RevisionRecord
Page revision base class.
Definition: RevisionRecord.php:47
ParserOutput
Definition: ParserOutput.php:36
PoolWorkArticleViewOld\$cache
RevisionOutputCache $cache
Definition: PoolWorkArticleViewOld.php:33
PoolWorkArticleView
PoolCounter protected work wrapping RenderedRevision->getRevisionParserOutput.
Definition: PoolWorkArticleView.php:34
PoolWorkArticleViewOld
PoolWorkArticleView for an old revision of a page, using a simple cache.
Definition: PoolWorkArticleViewOld.php:30
PoolWorkArticleViewOld\__construct
__construct(string $workKey, RevisionOutputCache $cache, RevisionRecord $revision, ParserOptions $parserOptions, RevisionRenderer $revisionRenderer, LoggerSpi $loggerSpi)
Definition: PoolWorkArticleViewOld.php:43
PoolWorkArticleView\$parserOptions
ParserOptions $parserOptions
Definition: PoolWorkArticleView.php:37
PoolWorkArticleViewOld\getCachedWork
getCachedWork()
Definition: PoolWorkArticleViewOld.php:69
PoolWorkArticleView\$parserOutput
ParserOutput bool $parserOutput
Definition: PoolWorkArticleView.php:46
PoolWorkArticleView\$loggerSpi
LoggerSpi $loggerSpi
Definition: PoolWorkArticleView.php:58
MediaWiki\Revision\RevisionRenderer
The RevisionRenderer service provides access to rendered output for revisions.
Definition: RevisionRenderer.php:45
Parser\RevisionOutputCache
Cache for ParserOutput objects.
Definition: RevisionOutputCache.php:44
MediaWiki\Logger\Spi
Service provider interface for \Psr\Log\LoggerInterface implementation libraries.
Definition: Spi.php:38
PoolWorkArticleView\$revision
RevisionRecord null $revision
Definition: PoolWorkArticleView.php:40