MediaWiki REL1_31
|
Public Member Functions | |
__construct (BagOStuff $cache, $cacheEpoch='20030516000000') | |
Setup a cache pathway with a given back-end storage mechanism. | |
deleteOptionsKey ( $page) | |
get ( $article, $popts, $useOutdated=false) | |
Retrieve the ParserOutput from ParserCache. | |
getCacheStorage () | |
Get the backend BagOStuff instance that powers the parser cache. | |
getDirty ( $article, $popts) | |
Retrieve the ParserOutput from ParserCache, even if it's outdated. | |
getETag ( $article, $popts) | |
Provides an E-Tag suitable for the whole page. | |
getKey ( $article, $popts, $useOutdated=self::USE_ANYTHING) | |
Generates a key for caching the given article considering the given parser options. | |
save ( $parserOutput, $page, $popts, $cacheTime=null, $revId=null) | |
Static Public Member Functions | |
static | singleton () |
Get an instance of this object. | |
Public Attributes | |
const | USE_ANYTHING = 3 |
Use expired data and data from different revisions, and if all else fails vary on all variable options. | |
const | USE_CURRENT_ONLY = 0 |
Constants for self::getKey() | |
const | USE_EXPIRED = 1 |
Use expired data if current data is unavailable. | |
const | USE_OUTDATED = 2 |
Use expired data or data from different revisions if current data is unavailable. | |
Protected Member Functions | |
getOptionsKey ( $page) | |
getParserOutputKey ( $article, $hash) | |
Private Attributes | |
string | $cacheEpoch |
Anything cached prior to this is invalidated. | |
BagOStuff | $mMemc |
Definition at line 30 of file ParserCache.php.
ParserCache::__construct | ( | BagOStuff | $cache, |
$cacheEpoch = '20030516000000' ) |
Setup a cache pathway with a given back-end storage mechanism.
This class use an invalidation strategy that is compatible with MultiWriteBagOStuff in async replication mode.
BagOStuff | $cache | |
string | $cacheEpoch | Anything before this timestamp is invalidated |
MWException |
Definition at line 80 of file ParserCache.php.
References $cache.
ParserCache::deleteOptionsKey | ( | $page | ) |
WikiPage | $page |
Definition at line 113 of file ParserCache.php.
References getOptionsKey().
ParserCache::get | ( | $article, | |
$popts, | |||
$useOutdated = false ) |
Retrieve the ParserOutput from ParserCache.
false if not found or outdated.
WikiPage | Article | $article | |
ParserOptions | $popts | |
bool | $useOutdated | (default false) |
Definition at line 228 of file ParserCache.php.
References $article, $value, getKey(), wfDebug(), wfDebugLog(), and wfIncrStats().
ParserCache::getCacheStorage | ( | ) |
Get the backend BagOStuff instance that powers the parser cache.
Definition at line 351 of file ParserCache.php.
ParserCache::getDirty | ( | $article, | |
$popts ) |
Retrieve the ParserOutput from ParserCache, even if it's outdated.
WikiPage | $article | |
ParserOptions | $popts |
Definition at line 143 of file ParserCache.php.
ParserCache::getETag | ( | $article, | |
$popts ) |
Provides an E-Tag suitable for the whole page.
Note that $article is just the main wikitext. The E-Tag has to be unique to the whole page, even if the article itself is the same, so it uses the complete set of user options. We don't want to use the preference of a different user on a message just because it wasn't used in $article. For example give a Chinese interface to a user with English preferences. That's why we take into account all user options. (r70809 CR)
WikiPage | $article | |
ParserOptions | $popts |
Definition at line 131 of file ParserCache.php.
References getParserOutputKey().
ParserCache::getKey | ( | $article, | |
$popts, | |||
$useOutdated = self::USE_ANYTHING ) |
Generates a key for caching the given article considering the given parser options.
WikiPage | $article | |
ParserOptions | $popts | |
int | bool | $useOutdated | One of the USE constants. For backwards compatibility, boolean false is treated as USE_CURRENT_ONLY and boolean true is treated as USE_ANYTHING. |
Definition at line 168 of file ParserCache.php.
References getOptionsKey(), getParserOutputKey(), wfDebug(), wfDebugLog(), wfIncrStats(), and wfWarn().
Referenced by get().
|
protected |
WikiPage | $page |
Definition at line 105 of file ParserCache.php.
Referenced by deleteOptionsKey(), getKey(), and save().
|
protected |
WikiPage | $article | |
string | $hash |
Definition at line 90 of file ParserCache.php.
References $wgRequest.
ParserCache::save | ( | $parserOutput, | |
$page, | |||
$popts, | |||
$cacheTime = null, | |||
$revId = null ) |
ParserOutput | $parserOutput | |
WikiPage | $page | |
ParserOptions | $popts | |
string | $cacheTime | Time when the cache was generated |
int | $revId | Revision ID that was parsed |
Definition at line 297 of file ParserCache.php.
References getOptionsKey(), getParserOutputKey(), CacheTime\updateCacheExpiry(), wfDebug(), and wfTimestampNow().
|
static |
Get an instance of this object.
Definition at line 66 of file ParserCache.php.
|
private |
Anything cached prior to this is invalidated.
Definition at line 59 of file ParserCache.php.
|
private |
Definition at line 52 of file ParserCache.php.
const ParserCache::USE_ANYTHING = 3 |
Use expired data and data from different revisions, and if all else fails vary on all variable options.
Definition at line 49 of file ParserCache.php.
const ParserCache::USE_CURRENT_ONLY = 0 |
Constants for self::getKey()
Definition at line 37 of file ParserCache.php.
const ParserCache::USE_EXPIRED = 1 |
Use expired data if current data is unavailable.
Definition at line 40 of file ParserCache.php.
const ParserCache::USE_OUTDATED = 2 |
Use expired data or data from different revisions if current data is unavailable.
Definition at line 43 of file ParserCache.php.