31use Psr\Log\LoggerInterface;
45 public const DEFAULT_NAME =
'pcache';
48 public const DEFAULT_RCACHE_NAME =
'rcache';
51 private $parserCacheBackend;
54 private $revisionOutputCacheBackend;
57 private $hookContainer;
69 private $titleFactory;
72 private $wikiPageFactory;
77 private $parserCaches = [];
80 private $revisionOutputCaches = [];
112 LoggerInterface $logger,
118 $this->parserCacheBackend = $parserCacheBackend;
119 $this->revisionOutputCacheBackend = $revisionOutputCacheBackend;
120 $this->hookContainer = $hookContainer;
121 $this->jsonCodec = $jsonCodec;
122 $this->stats = $stats;
123 $this->logger = $logger;
126 $this->options = $options;
127 $this->titleFactory = $titleFactory;
128 $this->wikiPageFactory = $wikiPageFactory;
129 $this->globalIdGenerator = $globalIdGenerator;
138 if ( !isset( $this->parserCaches[$name] ) ) {
139 $this->logger->debug(
"Creating ParserCache instance for {$name}" );
142 $this->parserCacheBackend,
144 $this->hookContainer,
149 $this->wikiPageFactory,
150 $this->globalIdGenerator
155 if ( isset( $filterConfig[$name] ) ) {
157 $cache->setFilter( $filter );
160 $this->parserCaches[$name] = $cache;
162 return $this->parserCaches[$name];
171 if ( !isset( $this->revisionOutputCaches[$name] ) ) {
172 $this->logger->debug(
"Creating RevisionOutputCache instance for {$name}" );
175 $this->revisionOutputCacheBackend,
181 $this->globalIdGenerator
184 $this->revisionOutputCaches[$name] = $cache;
186 return $this->revisionOutputCaches[$name];
if(!defined('MW_SETUP_CALLBACK'))
A class containing constants representing the names of configuration variables.
const OldRevisionParserCacheExpireTime
Name constant for the OldRevisionParserCacheExpireTime setting, for use with Config::get()
const ParserCacheFilterConfig
Name constant for the ParserCacheFilterConfig 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.