BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
ParserCache Class Reference
Inheritance diagram for ParserCache:

Public Member Functions

 getETag ($article, $popts)
 
 getDirty ($article, $popts)
 
 getKey ($article, $popts, $useOutdated=true)
 
 save ($parserOutput, $page, $popts, $cacheTime=null, $revId=null)
 

Static Public Member Functions

static singleton ()
 

Protected Member Functions

 __construct (BagOStuff $memCached)
 
 getParserOutputKey ($article, $hash)
 
 getOptionsKey ($article)
 

Detailed Description

Todo:
document

Constructor & Destructor Documentation

ParserCache::__construct ( BagOStuff  $memCached)
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.

Parameters
BagOStuff$memCached
Exceptions
MWException

Member Function Documentation

ParserCache::getDirty (   $article,
  $popts 
)

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

Parameters
WikiPage$article
ParserOptions$popts
Returns
ParserOutput|bool False on failure
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
WikiPage$article
ParserOptions$popts
Returns
string
ParserCache::getKey (   $article,
  $popts,
  $useOutdated = true 
)

Generates a key for caching the given article considering the given parser options.

Note
Which parser options influence the cache key is controlled via ParserOutput::recordOption() or ParserOptions::addExtraKey().
Used by Article 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
WikiPage$article
ParserOptions$popts
bool$useOutdated(default true)
Returns
bool|mixed|string
ParserCache::getOptionsKey (   $article)
protected
Parameters
WikiPage$article
Returns
mixed|string
ParserCache::getParserOutputKey (   $article,
  $hash 
)
protected
Parameters
WikiPage$article
string$hash
Returns
mixed|string
ParserCache::save (   $parserOutput,
  $page,
  $popts,
  $cacheTime = null,
  $revId = null 
)
Parameters
ParserOutput$parserOutput
WikiPage$page
ParserOptions$popts
string$cacheTimeTime when the cache was generated
int$revIdRevision ID that was parsed
static ParserCache::singleton ( )
static

Get an instance of this object

Returns
ParserCache

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