MediaWiki
1.28.0
|
Public Member Functions | |
deleteOptionsKey ($page) | |
get ($article, $popts, $useOutdated=false) | |
Retrieve the ParserOutput from ParserCache. More... | |
getDirty ($article, $popts) | |
Retrieve the ParserOutput from ParserCache, even if it's outdated. More... | |
getETag ($article, $popts) | |
Provides an E-Tag suitable for the whole page. More... | |
getKey ($article, $popts, $useOutdated=true) | |
Generates a key for caching the given article considering the given parser options. More... | |
save ($parserOutput, $page, $popts, $cacheTime=null, $revId=null) | |
Static Public Member Functions | |
static | singleton () |
Get an instance of this object. More... | |
Protected Member Functions | |
__construct (BagOStuff $memCached) | |
Setup a cache pathway with a given back-end storage mechanism. More... | |
getOptionsKey ($page) | |
getParserOutputKey ($article, $hash) | |
Private Attributes | |
BagOStuff | $mMemc |
Definition at line 28 of file ParserCache.php.
|
protected |
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 | $memCached |
MWException |
Definition at line 54 of file ParserCache.php.
ParserCache::deleteOptionsKey | ( | $page | ) |
WikiPage | $page |
Definition at line 86 of file ParserCache.php.
References $page, and 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 196 of file ParserCache.php.
References $article, $revId, $value, $wgCacheEpoch, getKey(), global, BagOStuff\READ_VERIFIED, Hooks\run(), wfDebug(), wfDebugLog(), and wfIncrStats().
ParserCache::getDirty | ( | $article, | |
$popts | |||
) |
Retrieve the ParserOutput from ParserCache, even if it's outdated.
WikiPage | $article | |
ParserOptions | $popts |
Definition at line 116 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 104 of file ParserCache.php.
References $article, getParserOutputKey(), and ParserOptions\legacyOptions().
ParserCache::getKey | ( | $article, | |
$popts, | |||
$useOutdated = true |
|||
) |
Generates a key for caching the given article considering the given parser options.
WikiPage | $article | |
ParserOptions | $popts | |
bool | $useOutdated | (default true) |
Definition at line 140 of file ParserCache.php.
References $article, $revId, $wgCacheEpoch, getOptionsKey(), getParserOutputKey(), global, ParserOptions\legacyOptions(), ParserOptions\newFromUser(), BagOStuff\READ_VERIFIED, wfDebug(), wfDebugLog(), wfIncrStats(), and wfWarn().
Referenced by get().
|
protected |
WikiPage | $page |
Definition at line 78 of file ParserCache.php.
References $page, and wfMemcKey().
Referenced by deleteOptionsKey(), getKey(), and save().
|
protected |
WikiPage | $article | |
string | $hash |
Definition at line 63 of file ParserCache.php.
References $article, $wgRequest, global, and wfMemcKey().
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 270 of file ParserCache.php.
References $page, $parserOutput, $revId, getOptionsKey(), getParserOutputKey(), Hooks\run(), wfDebug(), and wfTimestampNow().
|
static |
Get an instance of this object.
Definition at line 36 of file ParserCache.php.
References $parserMemc, and global.
Referenced by PoolWorkArticleView\__construct(), WikiPage\doEditUpdates(), WikiPage\doPurge(), PoolWorkArticleView\doWork(), CompareParserCache\execute(), ApiPurge\execute(), PoolWorkArticleView\fallback(), PoolWorkArticleView\getCachedWork(), WikiPage\getParserOutput(), RefreshLinksJob\runForTitle(), and Article\view().
|
private |
Definition at line 30 of file ParserCache.php.