MediaWiki  REL1_19
ParserCache Class Reference

List of all members.

Public Member Functions

 get ($article, $popts, $useOutdated=false)
 Retrieve the ParserOutput from ParserCache.
 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=true)
 Used to provide a unique id for the PoolCounter.
 save ($parserOutput, $article, $popts)

Static Public Member Functions

static singleton ()
 Get an instance of this object.

Public Attributes

const try116cache = false

Protected Member Functions

 __construct ($memCached)
 Setup a cache pathway with a given back-end storage mechanism.
 getOptionsKey ($article)
 getParserOutputKey ($article, $hash)

Private Attributes

 $mMemc

Detailed Description

Todo:
document

Definition at line 12 of file ParserCache.php.


Constructor & Destructor Documentation

ParserCache::__construct ( memCached) [protected]

Setup a cache pathway with a given back-end storage mechanism.

May be a memcached client or a BagOStuff derivative.

Parameters:
$memCachedObject

Definition at line 36 of file ParserCache.php.


Member Function Documentation

ParserCache::get ( article,
popts,
useOutdated = false 
)

Retrieve the ParserOutput from ParserCache.

false if not found or outdated.

Parameters:
$articleArticle
$poptsParserOptions
$useOutdated
Returns:
ParserOutput|false

Definition at line 148 of file ParserCache.php.

References $wgCacheEpoch, getKey(), getParserOutputKey(), ParserOptions\legacyOptions(), wfDebug(), wfIncrStats(), wfProfileIn(), and wfProfileOut().

Here is the call graph for this function:

ParserCache::getDirty ( article,
popts 
)

Retrieve the ParserOutput from ParserCache, even if it's outdated.

Parameters:
$articleArticle
$poptsParserOptions
Returns:
ParserOutput|false

Definition at line 93 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)

Parameters:
$articleArticle
$poptsParserOptions

Definition at line 81 of file ParserCache.php.

References getParserOutputKey(), and ParserOptions\legacyOptions().

Here is the call graph for this function:

ParserCache::getKey ( article,
popts,
useOutdated = true 
)

Used to provide a unique id for the PoolCounter.

It would be preferable to have this code in get() instead of having Article looking in our internals.

Todo:
Document parameter $useOutdated
Parameters:
$articleArticle
$poptsParserOptions

Definition at line 108 of file ParserCache.php.

References $wgCacheEpoch, getOptionsKey(), getParserOutputKey(), ParserOptions\legacyOptions(), ParserOptions\newFromUser(), wfDebug(), wfIncrStats(), and wfWarn().

Referenced by get().

Here is the call graph for this function:

Here is the caller graph for this function:

ParserCache::getOptionsKey ( article) [protected]
Parameters:
$articleArticle
Returns:
mixed|string

Definition at line 63 of file ParserCache.php.

References wfMemcKey().

Referenced by getKey(), and save().

Here is the call graph for this function:

Here is the caller graph for this function:

ParserCache::getParserOutputKey ( article,
hash 
) [protected]
Parameters:
$articleArticle
$hashstring
Returns:
mixed|string

Definition at line 48 of file ParserCache.php.

References wfMemcKey().

Referenced by get(), getETag(), getKey(), and save().

Here is the call graph for this function:

Here is the caller graph for this function:

ParserCache::save ( parserOutput,
article,
popts 
)
Parameters:
$parserOutputParserOutput
$articleArticle
$poptsParserOptions

Definition at line 207 of file ParserCache.php.

References getOptionsKey(), getParserOutputKey(), CacheTime\updateCacheExpiry(), wfDebug(), and wfTimestampNow().

Here is the call graph for this function:


Member Data Documentation

ParserCache::$mMemc [private]

Definition at line 13 of file ParserCache.php.

Definition at line 14 of file ParserCache.php.


The documentation for this class was generated from the following file: