Semantic MediaWiki and related extensions
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
SMW\EntityCache Class Reference

Public Member Functions

 __construct (Cache $cache)
 
 makeKey (... $params)
 
 getStats ()
 
 contains ( $key)
 
 fetch ( $key)
 
 save ( $key, $value=null, $ttl=0)
 
 delete ( $key)
 
 fetchSub ( $key, $sub)
 
 saveSub ( $key, $sub, $value=null, $ttl=0)
 
 overrideSub ( $key, $sub, $value=null, $ttl=0)
 
 deleteSub ( $key, $sub, $ttl=0)
 
 associate ( $subject, $key)
 
 invalidate ( $subject=null)
 

Static Public Member Functions

static makeCacheKey (... $params)
 

Public Attributes

const CACHE_NAMESPACE = 'smw:entity'
 
const VERSION = 1
 
const TTL_SECOND = 1
 
const TTL_MINUTE = 60
 
const TTL_HOUR = 3600
 
const TTL_DAY = 86400
 
const TTL_WEEK = 604800
 
const TTL_MONTH = 2592000
 
const TTL_YEAR = 31536000
 

Detailed Description

Class provides a simple interface the link independent cache entries as associates (to a wikipage) hereby allowing them to be invalidated at once.

...Sub methods provide a convenient support layer to extend or remove values from a cache entry.

GNU GPL v2+

Since
3.1
Author
mwjames

Constructor & Destructor Documentation

◆ __construct()

SMW\EntityCache::__construct ( Cache  $cache)
Since
3.1
Parameters
Cache$cache

Member Function Documentation

◆ associate()

SMW\EntityCache::associate (   $subject,
  $key 
)

Bind a cache key to a subject so that when a page gets flushed or modified, any associate keys can be invalidated at once.

Since
3.1
Parameters
DIWikiPage | Title$subject

◆ contains()

SMW\EntityCache::contains (   $key)
Since
3.1
Parameters
string$key
Returns
boolean

◆ delete()

SMW\EntityCache::delete (   $key)
Since
3.1
Parameters
string$key

◆ deleteSub()

SMW\EntityCache::deleteSub (   $key,
  $sub,
  $ttl = 0 
)
Since
3.1
Parameters
string$key
string$sub
integer$ttl

◆ fetch()

SMW\EntityCache::fetch (   $key)
Since
3.1
Parameters
string$key
mixed$value

◆ fetchSub()

SMW\EntityCache::fetchSub (   $key,
  $sub 
)
Since
3.1
Parameters
string$key
mixed$value

◆ getStats()

SMW\EntityCache::getStats ( )
Since
3.1
Returns
[]

◆ invalidate()

SMW\EntityCache::invalidate (   $subject = null)
Since
3.1
Parameters
DIWikiPage | Title$subject

◆ makeCacheKey()

static SMW\EntityCache::makeCacheKey (   $params)
static
Since
3.1
Parameters
string | array$key
Returns
string

◆ makeKey()

SMW\EntityCache::makeKey (   $params)
Since
3.1
Parameters
string | array$key
Returns
string

◆ overrideSub()

SMW\EntityCache::overrideSub (   $key,
  $sub,
  $value = null,
  $ttl = 0 
)
Since
3.1
Parameters
string$key
string$sub
mixed$value
integer$ttl

◆ save()

SMW\EntityCache::save (   $key,
  $value = null,
  $ttl = 0 
)
Since
3.1
Parameters
string$key
mixed$value

◆ saveSub()

SMW\EntityCache::saveSub (   $key,
  $sub,
  $value = null,
  $ttl = 0 
)
Since
3.1
Parameters
string$key
string$sub
mixed$value
integer$ttl

Member Data Documentation

◆ CACHE_NAMESPACE

const SMW\EntityCache::CACHE_NAMESPACE = 'smw:entity'

Repository specific namespace

◆ TTL_SECOND

const SMW\EntityCache::TTL_SECOND = 1

TTLs


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

About | General disclaimer | Privacy policy