Stud.IP  5.4
StudipCache Interface Reference
Inheritance diagram for StudipCache:
StudipCacheProxy StudipCacheWrapper StudipDbCache StudipFileCache StudipMemcachedCache StudipMemoryCache StudipRedisCache

Public Member Functions

 expire ($arg)
 
 flush ()
 
 read ($arg)
 
 write ($name, $content, $expires=self::DEFAULT_EXPIRATION)
 
 getStats ()
 

Static Public Member Functions

static getDisplayName ()
 
static getConfig ()
 

Data Fields

const DEFAULT_EXPIRATION = 12 * 60 * 60
 

Member Function Documentation

◆ expire()

expire (   $arg)

Expire item from the cache.

Example:

expires foo

$cache->expire('foo');

Parameters
string$arga single key

Implemented in StudipFileCache, StudipRedisCache, StudipMemcachedCache, StudipCacheProxy, StudipCacheWrapper, StudipDbCache, and StudipMemoryCache.

◆ flush()

flush ( )

◆ getConfig()

static getConfig ( )
static

Return the Vue component name and props that handle configuration. The associative array is of the form [ 'component' => <Vue component="" name>="">, 'props' => <Properties for="" component>=""> ]

Returns
array

Implemented in StudipFileCache, StudipRedisCache, StudipMemcachedCache, StudipDbCache, StudipCacheProxy, StudipCacheWrapper, and StudipMemoryCache.

◆ getDisplayName()

static getDisplayName ( )
static
Returns
string A translateable display name for this cache class.

Implemented in StudipCacheProxy, StudipCacheWrapper, StudipMemoryCache, StudipFileCache, StudipMemcachedCache, StudipRedisCache, and StudipDbCache.

◆ getStats()

getStats ( )

Get some statistics from cache, like number of entries, hit rate or whatever the underlying cache provides. Results are returned in form of an array like "[ [ 'name' => <displayable name>=""> 'value' =>

] ]"

Returns
array

Implemented in StudipFileCache, StudipRedisCache, StudipMemcachedCache, StudipCacheProxy, StudipDbCache, StudipCacheWrapper, and StudipMemoryCache.

◆ read()

read (   $arg)

Retrieve item from the server.

Example:

reads foo

$foo = $cache->reads('foo');

Parameters
string$arga single key
Returns
mixed the previously stored data if an item with such a key exists on the server or FALSE on failure.

Implemented in StudipFileCache, StudipMemcachedCache, StudipRedisCache, StudipCacheProxy, StudipDbCache, StudipCacheWrapper, and StudipMemoryCache.

◆ write()

write (   $name,
  $content,
  $expires = self::DEFAULT_EXPIRATION 
)

Store data at the server.

Parameters
string$namethe item's key.
mixed$contentthe item's content (will be serialized if necessary).
int$expiresthe item's expiry time in seconds. Optional, defaults to 12h.
Returns
bool returns TRUE on success or FALSE on failure.

Implemented in StudipFileCache, StudipMemcachedCache, StudipRedisCache, StudipCacheProxy, StudipDbCache, StudipCacheWrapper, and StudipMemoryCache.

Field Documentation

◆ DEFAULT_EXPIRATION

const DEFAULT_EXPIRATION = 12 * 60 * 60

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