MediaWiki  REL1_22
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, $cacheTime=null)

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 28 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
Exceptions:
MWException

Definition at line 53 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
$useOutdatedBoolean (default false)
Returns:
ParserOutput|bool False on failure

Definition at line 168 of file ParserCache.php.

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

ParserCache::getDirty ( article,
popts 
)

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

Parameters:
$articleArticle
$poptsParserOptions
Returns:
ParserOutput|bool False on failure

Definition at line 111 of file ParserCache.php.

References $article, $value, and true.

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
Returns:
string

Definition at line 99 of file ParserCache.php.

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

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
$useOutdatedBoolean (default true)
Returns:
bool|mixed|string

Definition at line 128 of file ParserCache.php.

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

Referenced by get().

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

Definition at line 80 of file ParserCache.php.

References $article, and wfMemcKey().

Referenced by getKey(), and save().

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

Definition at line 65 of file ParserCache.php.

References $article, $key, global, and wfMemcKey().

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

ParserCache::save ( parserOutput,
article,
popts,
cacheTime = null 
)
Parameters:
$parserOutputParserOutput
$articleArticle
$poptsParserOptions
$cacheTimeTime when the cache was generated

Definition at line 228 of file ParserCache.php.

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

static ParserCache::singleton ( ) [static]

Get an instance of this object.

Returns:
ParserCache

Definition at line 37 of file ParserCache.php.

References $parserMemc, and global.

Referenced by ApiPurge\execute().


Member Data Documentation

ParserCache::$mMemc [private]

Definition at line 29 of file ParserCache.php.

Definition at line 30 of file ParserCache.php.


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