Semantic MediaWiki and related extensions
Public Member Functions | List of all members
SMW\Factbox\CachedFactbox Class Reference

Public Member Functions

 __construct (Cache $cache=null)
 
 isCached ()
 
 setExpiryInSeconds ($expiryInSeconds)
 
 isEnabled ($isEnabled)
 
 getTimestamp ()
 
 prepareFactboxContent (OutputPage &$outputPage, ParserOutput $parserOutput)
 
 addContentToCache ($key, $text, $revisionId=null)
 
 retrieveContent (OutputPage $outputPage)
 

Detailed Description

Factbox output caching

Enable ($smwgFactboxUseCache) to use a CacheStore to avoid unaltered content being re-parsed every time the OutputPage hook is executed

GNU GPL v2+

Since
1.9
Author
mwjames

Constructor & Destructor Documentation

SMW\Factbox\CachedFactbox::__construct ( Cache  $cache = null)
Since
1.9
Parameters
Cache | null$cache

Member Function Documentation

SMW\Factbox\CachedFactbox::addContentToCache (   $key,
  $text,
  $revisionId = null 
)
Since
2.2
Parameters
string$key
string$text
integer | null$revisionId
SMW\Factbox\CachedFactbox::getTimestamp ( )
Since
2.2
Returns
integer
SMW\Factbox\CachedFactbox::isCached ( )
Since
1.9
Returns
boolean
SMW\Factbox\CachedFactbox::isEnabled (   $isEnabled)
Since
2.5
Returns
boolean
SMW\Factbox\CachedFactbox::prepareFactboxContent ( OutputPage &  $outputPage,
ParserOutput  $parserOutput 
)

Prepare and update the OutputPage property

Factbox content is either retrived from a CacheStore or re-parsed from the Factbox object

Altered content is tracked using the revision Id, getLatestRevID() only changes after a content modification has occurred.

Since
1.9
Parameters
OutputPage&$outputPage
ParserOutput$parserOutput
SMW\Factbox\CachedFactbox::retrieveContent ( OutputPage  $outputPage)

Returns parsed Factbox content from either the OutputPage property or from the Cache

Since
1.9
Parameters
OutputPage$outputPage
Returns
string
SMW\Factbox\CachedFactbox::setExpiryInSeconds (   $expiryInSeconds)
Since
2.5
Returns
boolean

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