30use Psr\Log\LoggerInterface;
44 public const DEFAULT_NAME =
'pcache';
47 public const DEFAULT_RCACHE_NAME =
'rcache';
50 private $parserCacheBackend;
53 private $revisionOutputCacheBackend;
56 private $hookContainer;
68 private $titleFactory;
71 private $wikiPageFactory;
76 private $parserCaches = [];
79 private $revisionOutputCaches = [];
111 LoggerInterface $logger,
117 $this->parserCacheBackend = $parserCacheBackend;
118 $this->revisionOutputCacheBackend = $revisionOutputCacheBackend;
119 $this->hookContainer = $hookContainer;
120 $this->jsonCodec = $jsonCodec;
121 $this->stats = $stats;
122 $this->logger = $logger;
125 $this->options = $options;
126 $this->titleFactory = $titleFactory;
127 $this->wikiPageFactory = $wikiPageFactory;
128 $this->globalIdGenerator = $globalIdGenerator;
137 if ( !isset( $this->parserCaches[$name] ) ) {
138 $this->logger->debug(
"Creating ParserCache instance for {$name}" );
141 $this->parserCacheBackend,
143 $this->hookContainer,
148 $this->wikiPageFactory,
149 $this->globalIdGenerator
154 if ( isset( $filterConfig[$name] ) ) {
156 $cache->setFilter( $filter );
159 $this->parserCaches[$name] = $cache;
161 return $this->parserCaches[$name];
170 if ( !isset( $this->revisionOutputCaches[$name] ) ) {
171 $this->logger->debug(
"Creating RevisionOutputCache instance for {$name}" );
174 $this->revisionOutputCacheBackend,
180 $this->globalIdGenerator
183 $this->revisionOutputCaches[$name] = $cache;
185 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.