Stud.IP  4.2 Revision
StudipCache Interface Reference
Inheritance diagram for StudipCache:
Inheritance graph
Collaboration diagram for StudipCache:
Collaboration graph

Public Member Functions

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

Data Fields

const DEFAULT_EXPIRATION = 43200
 

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, StudipCacheProxy, StudipNullCache, and StudipDbCache.

◆ flush()

flush ( )

Expire all items from the cache.

Implemented in StudipFileCache, StudipCacheProxy, StudipNullCache, and StudipDbCache.

◆ 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, StudipCacheProxy, StudipDbCache, and StudipNullCache.

◆ 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$expiredthe item's expiry time in seconds. Optional, defaults to 12h.
Returns
bool returns TRUE on success or FALSE on failure.

Implemented in StudipFileCache, StudipCacheProxy, StudipDbCache, and StudipNullCache.

Field Documentation

◆ DEFAULT_EXPIRATION

const DEFAULT_EXPIRATION = 43200

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