MediaWiki REL1_37
PoolWorkArticleViewOld.php
Go to the documentation of this file.
1<?php
20use MediaWiki\Logger\Spi as LoggerSpi;
24
31
33 private $cache;
34
43 public function __construct(
44 string $workKey,
46 RevisionRecord $revision,
47 ParserOptions $parserOptions,
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}
Cache for ParserOutput objects.
Page revision base class.
The RevisionRenderer service provides access to rendered output for revisions.
Set options of the Parser.
PoolWorkArticleView for an old revision of a page, using a simple cache.
saveInCache(ParserOutput $output, string $cacheTime)
__construct(string $workKey, RevisionOutputCache $cache, RevisionRecord $revision, ParserOptions $parserOptions, RevisionRenderer $revisionRenderer, LoggerSpi $loggerSpi)
PoolCounter protected work wrapping RenderedRevision->getRevisionParserOutput.
Service provider interface for \Psr\Log\LoggerInterface implementation libraries.
Definition Spi.php:38
$cache
Definition mcc.php:33