MediaWiki REL1_40
|
Cache for ParserOutput objects. More...
Public Member Functions | |
__construct (string $name, WANObjectCache $cache, int $cacheExpiry, string $cacheEpoch, JsonCodec $jsonCodec, IBufferingStatsdDataFactory $stats, LoggerInterface $logger) | |
get (RevisionRecord $revision, ParserOptions $parserOptions) | |
Retrieve the ParserOutput from cache. | |
makeParserOutputKey (RevisionRecord $revision, ParserOptions $options, array $usedOptions=null) | |
Get a key that will be used by this cache to store the content for a given page considering the given options and the array of used options. | |
makeParserOutputKeyOptionalRevId (RevisionRecord $revision, ParserOptions $options, array $usedOptions=null) | |
Get a key that will be used for locks or pool counter. | |
save (ParserOutput $output, RevisionRecord $revision, ParserOptions $parserOptions, string $cacheTime=null) | |
Cache for ParserOutput objects.
The cache is split per ParserOptions.
Definition at line 44 of file RevisionOutputCache.php.
MediaWiki\Parser\RevisionOutputCache::__construct | ( | string | $name, |
WANObjectCache | $cache, | ||
int | $cacheExpiry, | ||
string | $cacheEpoch, | ||
JsonCodec | $jsonCodec, | ||
IBufferingStatsdDataFactory | $stats, | ||
LoggerInterface | $logger ) |
string | $name | |
WANObjectCache | $cache | |
int | $cacheExpiry | Expiry for ParserOutput in $cache. |
string | $cacheEpoch | Anything before this timestamp is invalidated |
JsonCodec | $jsonCodec | |
IBufferingStatsdDataFactory | $stats | |
LoggerInterface | $logger |
Definition at line 84 of file RevisionOutputCache.php.
MediaWiki\Parser\RevisionOutputCache::get | ( | RevisionRecord | $revision, |
ParserOptions | $parserOptions ) |
Retrieve the ParserOutput from cache.
false if not found or outdated.
RevisionRecord | $revision | |
ParserOptions | $parserOptions |
Definition at line 183 of file RevisionOutputCache.php.
MediaWiki\Parser\RevisionOutputCache::makeParserOutputKey | ( | RevisionRecord | $revision, |
ParserOptions | $options, | ||
array | $usedOptions = null ) |
Get a key that will be used by this cache to store the content for a given page considering the given options and the array of used options.
If there is a possibility the revision does not have a revision id, use makeParserOutputKeyOptionalRevId() instead.
RevisionRecord | $revision | |
ParserOptions | $options | |
array | null | $usedOptions | currently ignored |
Definition at line 128 of file RevisionOutputCache.php.
MediaWiki\Parser\RevisionOutputCache::makeParserOutputKeyOptionalRevId | ( | RevisionRecord | $revision, |
ParserOptions | $options, | ||
array | $usedOptions = null ) |
Get a key that will be used for locks or pool counter.
Similar to makeParserOutputKey except the revision id might be null, in which case it is unsafe to cache, but still needs a key for things like poolcounter.
RevisionRecord | $revision | |
ParserOptions | $options | |
array | null | $usedOptions | currently ignored |
Definition at line 161 of file RevisionOutputCache.php.
MediaWiki\Parser\RevisionOutputCache::save | ( | ParserOutput | $output, |
RevisionRecord | $revision, | ||
ParserOptions | $parserOptions, | ||
string | $cacheTime = null ) |
ParserOutput | $output | |
RevisionRecord | $revision | |
ParserOptions | $parserOptions | |
string | null | $cacheTime | TS_MW timestamp when the output was generated |
Definition at line 228 of file RevisionOutputCache.php.
References ParserOutput\addCacheMessage(), CacheTime\getCacheExpiry(), MediaWiki\Revision\RevisionRecord\getId(), MediaWiki\Revision\RevisionRecord\getTimestamp(), ParserOutput\hasText(), ParserOptions\isSafeToCache(), CacheTime\setCacheRevisionId(), CacheTime\setCacheTime(), ParserOutput\setTimestamp(), CacheTime\updateCacheExpiry(), and wfTimestampNow().