16use Psr\Log\LoggerInterface;
30 public const DEFAULT_NAME =
'pcache';
33 public const DEFAULT_RCACHE_NAME =
'rcache';
36 private $parserCaches = [];
39 private $revisionOutputCaches = [];
51 private readonly
BagOStuff $parserCacheBackend,
56 private readonly LoggerInterface $logger,
62 $options->assertRequiredOptions( self::CONSTRUCTOR_OPTIONS );
71 if ( !isset( $this->parserCaches[$name] ) ) {
72 $this->logger->debug(
"Creating ParserCache instance for {$name}" );
75 $this->parserCacheBackend,
82 $this->wikiPageFactory,
83 $this->globalIdGenerator
88 if ( isset( $filterConfig[$name] ) ) {
90 $cache->setFilter( $filter );
93 $this->parserCaches[$name] = $cache;
95 return $this->parserCaches[$name];
104 if ( !isset( $this->revisionOutputCaches[$name] ) ) {
105 $this->logger->debug(
"Creating RevisionOutputCache instance for {$name}" );
108 $this->revisionOutputCacheBackend,
114 $this->globalIdGenerator
117 $this->revisionOutputCaches[$name] = $cache;
119 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.