32use Psr\Log\LoggerInterface;
44 public const DEFAULT_NAME =
'pcache';
47 private $parserCacheBackend;
50 private $revisionOutputCacheBackend;
53 private $hookContainer;
65 private $titleFactory;
68 private $wikiPageFactory;
71 private $parserCaches = [];
74 private $revisionOutputCaches = [];
104 LoggerInterface $logger,
109 $this->parserCacheBackend = $parserCacheBackend;
110 $this->revisionOutputCacheBackend = $revisionOutputCacheBackend;
111 $this->hookContainer = $hookContainer;
112 $this->jsonCodec = $jsonCodec;
113 $this->stats = $stats;
114 $this->logger = $logger;
117 $this->options = $options;
118 $this->titleFactory = $titleFactory;
119 $this->wikiPageFactory = $wikiPageFactory;
128 if ( !isset( $this->parserCaches[$name] ) ) {
129 $this->logger->debug(
"Creating ParserCache instance for {$name}" );
132 $this->parserCacheBackend,
134 $this->hookContainer,
139 $this->wikiPageFactory
142 $this->parserCaches[$name] =
$cache;
144 return $this->parserCaches[$name];
153 if ( !isset( $this->revisionOutputCaches[$name] ) ) {
154 $this->logger->debug(
"Creating RevisionOutputCache instance for {$name}" );
157 $this->revisionOutputCacheBackend,
165 $this->revisionOutputCaches[$name] =
$cache;
167 return $this->revisionOutputCaches[$name];
if(!defined('MW_SETUP_CALLBACK'))
The persistent session ID (if any) loaded at startup.
Class representing a cache/ephemeral data store.
A class containing constants representing the names of configuration variables.
const OldRevisionParserCacheExpireTime
Name constant for the OldRevisionParserCacheExpireTime setting, for use with Config::get()
const CacheEpoch
Name constant for the CacheEpoch setting, for use with Config::get()
Service for creating WikiPage objects.
Cache for ParserOutput objects corresponding to the latest page revisions.
Multi-datacenter aware caching interface.
MediaWiki adaptation of StatsdDataFactory that provides buffering functionality.