Stud.IP  5.4
StudipCacheProxy Class Reference
Inheritance diagram for StudipCacheProxy:
StudipCache

Public Member Functions

 __construct (StudipCache $cache, $proxy_these=['expire'])
 
 expire ($key)
 
 flush ()
 
 read ($key)
 
 write ($key, $content, $expires=self::DEFAULT_EXPIRATION)
 
 getStats ()
 

Static Public Member Functions

static getDisplayName ()
 
static getConfig ()
 

Protected Attributes

 $actual_cache
 
 $proxy_these
 

Additional Inherited Members

- Data Fields inherited from StudipCache
const DEFAULT_EXPIRATION = 12 * 60 * 60
 

Detailed Description

Proxies a StudipCache and stores the expire operation in the database. These operations are lateron applied to the cache they should have been applied to in the beginning.

Author
Jan-Hendrik Willms tleil.nosp@m.ax+s.nosp@m.tudip.nosp@m.@gma.nosp@m.il.co.nosp@m.m GPL2 or any later version
Since
Stud.IP 3.3

Constructor & Destructor Documentation

◆ __construct()

__construct ( StudipCache  $cache,
  $proxy_these = ['expire'] 
)
Parameters
StudipCache$cacheThe actual cache object
mixed$proxy_theseList of operations to proxy (should be an array but a space seperated string is also valid)

Member Function Documentation

◆ expire()

expire (   $key)

Expires just a single key.

Parameters
string$keyThe item's key

Implements StudipCache.

◆ flush()

flush ( )

Expire all items from the cache.

Implements StudipCache.

◆ 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

Implements StudipCache.

◆ getDisplayName()

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

Implements StudipCache.

◆ 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

Implements StudipCache.

◆ read()

read (   $key)

Reads just a single key from the cache.

Parameters
string$keyThe item's key
Returns
mixed The corresponding value

Implements StudipCache.

◆ write()

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

Store data at the server.

Parameters
string$keyThe item's key
string$contentThe item's conten
int$expiresThe item's expiry time in seconds, defaults to 12h
Returns
bool Returns TRUE on success or FALSE on failure

Implements StudipCache.

Field Documentation

◆ $actual_cache

$actual_cache
protected

◆ $proxy_these

$proxy_these
protected

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