MediaWiki REL1_31
|
Parser cache specific expiry check. More...
Public Member Functions | |
expired ( $touched) | |
Return true if this cached output object predates the global or per-article cache invalidation timestamps, or if it comes from an incompatible older version. | |
getCacheExpiry () | |
Returns the number of seconds after which this object should expire. | |
getCacheRevisionId () | |
getCacheTime () | |
isCacheable () | |
isDifferentRevision ( $id) | |
Return true if this cached output object is for a different revision of the page. | |
setCacheRevisionId ( $id) | |
setCacheTime ( $t) | |
setCacheTime() sets the timestamp expressing when the page has been rendered. | |
updateCacheExpiry ( $seconds) | |
Sets the number of seconds after which this object should expire. | |
Public Attributes | |
$mCacheExpiry = null | |
$mCacheRevisionId = null | |
$mCacheTime = '' | |
array bool | $mUsedOptions |
ParserOptions which have been taken into account to produce output or false if not available. | |
$mVersion = Parser::VERSION | |
Parser cache specific expiry check.
Definition at line 29 of file CacheTime.php.
CacheTime::expired | ( | $touched | ) |
Return true if this cached output object predates the global or per-article cache invalidation timestamps, or if it comes from an incompatible older version.
string | $touched | The affected article's last touched timestamp |
Definition at line 147 of file CacheTime.php.
References $wgCacheEpoch, getCacheExpiry(), getCacheTime(), isCacheable(), and wfTimestamp().
CacheTime::getCacheExpiry | ( | ) |
Returns the number of seconds after which this object should expire.
This method is used by ParserCache to determine how long the ParserOutput can be cached. The timestamp of expiry can be calculated by adding getCacheExpiry() to getCacheTime(). The value returned by getCacheExpiry is smaller or equal to the smallest number that was provided to a call of updateCacheExpiry(), and smaller or equal to the value of $wgParserCacheExpireTime.
Definition at line 110 of file CacheTime.php.
References $mCacheExpiry, and $wgParserCacheExpireTime.
Referenced by ApiStashEdit\buildStashValue(), expired(), ParserOutput\hasDynamicContent(), isCacheable(), and WikiPage\triggerOpportunisticLinksUpdate().
CacheTime::getCacheRevisionId | ( | ) |
Definition at line 68 of file CacheTime.php.
References $mCacheRevisionId.
Referenced by isDifferentRevision().
CacheTime::getCacheTime | ( | ) |
Definition at line 50 of file CacheTime.php.
References wfTimestamp().
Referenced by expired(), and WikiPage\triggerOpportunisticLinksUpdate().
CacheTime::isCacheable | ( | ) |
Definition at line 135 of file CacheTime.php.
References getCacheExpiry().
Referenced by expired().
CacheTime::isDifferentRevision | ( | $id | ) |
Return true if this cached output object is for a different revision of the page.
int | $id | The affected article's current revision id |
Definition at line 171 of file CacheTime.php.
References getCacheRevisionId().
CacheTime::setCacheRevisionId | ( | $id | ) |
CacheTime::setCacheTime | ( | $t | ) |
setCacheTime() sets the timestamp expressing when the page has been rendered.
This does not control expiry, see updateCacheExpiry() for that!
string | $t | TS_MW timestamp |
Definition at line 60 of file CacheTime.php.
References $t, and wfSetVar().
CacheTime::updateCacheExpiry | ( | $seconds | ) |
Sets the number of seconds after which this object should expire.
This value is used with the ParserCache. If called with a value greater than the value provided at any previous call, the new call has no effect. The value returned by getCacheExpiry is smaller or equal to the smallest number that was provided as an argument to updateCacheExpiry().
Avoid using 0 if at all possible. Consider JavaScript for highly dynamic content.
int | $seconds |
Definition at line 93 of file CacheTime.php.
Referenced by ParserOutput\finalizeAdaptiveCacheExpiry(), ParserCache\save(), and ParserOutput\updateRuntimeAdaptiveExpiry().
CacheTime::$mCacheExpiry = null |
Definition at line 42 of file CacheTime.php.
Referenced by getCacheExpiry().
CacheTime::$mCacheRevisionId = null |
Definition at line 45 of file CacheTime.php.
Referenced by getCacheRevisionId().
CacheTime::$mCacheTime = '' |
Definition at line 39 of file CacheTime.php.
array bool CacheTime::$mUsedOptions |
ParserOptions which have been taken into account to produce output or false if not available.
Definition at line 33 of file CacheTime.php.
CacheTime::$mVersion = Parser::VERSION |
Definition at line 36 of file CacheTime.php.