MediaWiki REL1_37
|
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. | |
save (ParserOutput $output, RevisionRecord $revision, ParserOptions $parserOptions, string $cacheTime=null) | |
Private Member Functions | |
encodeAsJson (CacheTime $obj, string $key) | |
incrementStats (RevisionRecord $revision, string $metricSuffix) | |
restoreFromJson (string $jsonData, string $key, string $expectedClass) | |
Private Attributes | |
WANObjectCache | $cache |
string | $cacheEpoch |
Anything cached prior to this is invalidated. | |
string | $cacheExpiry |
Expiry time for cache entries. | |
JsonCodec | $jsonCodec |
LoggerInterface | $logger |
string | $name |
The name of this cache. | |
IBufferingStatsdDataFactory | $stats |
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.
References MediaWiki\Parser\RevisionOutputCache\$cache, MediaWiki\Parser\RevisionOutputCache\$cacheEpoch, MediaWiki\Parser\RevisionOutputCache\$cacheExpiry, MediaWiki\Parser\RevisionOutputCache\$jsonCodec, MediaWiki\Parser\RevisionOutputCache\$logger, MediaWiki\Parser\RevisionOutputCache\$name, and MediaWiki\Parser\RevisionOutputCache\$stats.
|
private |
CacheTime | $obj | |
string | $key |
Definition at line 272 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 148 of file RevisionOutputCache.php.
|
private |
RevisionRecord | $revision | |
string | $metricSuffix |
Definition at line 106 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.
RevisionRecord | $revision | |
ParserOptions | $options | |
array | null | $usedOptions | currently ignored |
Definition at line 126 of file RevisionOutputCache.php.
|
private |
string | $jsonData | |
string | $key | |
string | $expectedClass |
Definition at line 252 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 193 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().
|
private |
Definition at line 50 of file RevisionOutputCache.php.
Referenced by MediaWiki\Parser\RevisionOutputCache\__construct().
|
private |
Anything cached prior to this is invalidated.
Definition at line 57 of file RevisionOutputCache.php.
Referenced by MediaWiki\Parser\RevisionOutputCache\__construct().
|
private |
Expiry time for cache entries.
Definition at line 64 of file RevisionOutputCache.php.
Referenced by MediaWiki\Parser\RevisionOutputCache\__construct().
|
private |
Definition at line 67 of file RevisionOutputCache.php.
Referenced by MediaWiki\Parser\RevisionOutputCache\__construct().
|
private |
Definition at line 73 of file RevisionOutputCache.php.
Referenced by MediaWiki\Parser\RevisionOutputCache\__construct().
|
private |
The name of this cache.
Used as a root of the cache key.
Definition at line 47 of file RevisionOutputCache.php.
Referenced by MediaWiki\Parser\RevisionOutputCache\__construct().
|
private |
Definition at line 70 of file RevisionOutputCache.php.
Referenced by MediaWiki\Parser\RevisionOutputCache\__construct().