33 use 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;
74 private $parserCaches = [];
77 private $revisionOutputCaches = [];
104 HookContainer $hookContainer,
105 JsonCodec $jsonCodec,
107 LoggerInterface $logger,
108 ServiceOptions $options,
109 TitleFactory $titleFactory,
110 WikiPageFactory $wikiPageFactory
112 $this->parserCacheBackend = $parserCacheBackend;
113 $this->revisionOutputCacheBackend = $revisionOutputCacheBackend;
114 $this->hookContainer = $hookContainer;
115 $this->jsonCodec = $jsonCodec;
116 $this->stats = $stats;
117 $this->logger = $logger;
119 $options->assertRequiredOptions( self::CONSTRUCTOR_OPTIONS );
120 $this->options = $options;
121 $this->titleFactory = $titleFactory;
122 $this->wikiPageFactory = $wikiPageFactory;
131 if ( !isset( $this->parserCaches[$name] ) ) {
132 $this->logger->debug(
"Creating ParserCache instance for {$name}" );
135 $this->parserCacheBackend,
137 $this->hookContainer,
142 $this->wikiPageFactory
145 $this->parserCaches[$name] = $cache;
147 return $this->parserCaches[$name];
156 if ( !isset( $this->revisionOutputCaches[$name] ) ) {
157 $this->logger->debug(
"Creating RevisionOutputCache instance for {$name}" );
160 $this->revisionOutputCacheBackend,
168 $this->revisionOutputCaches[$name] = $cache;
170 return $this->revisionOutputCaches[$name];
if(!defined('MW_SETUP_CALLBACK'))
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.