Class rcube_cache

Description

Interface class for accessing Roundcube cache

Located in /rcube_cache.php (line 36)


	
			
Method Summary
 rcube_cache __construct (string $type, int $userid, [string $prefix = ''], [int $ttl = 0], [bool $packed = true])
 void close ()
 void expunge ()
 mixed get (string $key)
 mixed read (string $key)
 void remove ([string $key = null], [boolean $prefix_mode = false])
 void set (string $key, mixed $data)
 void write (string $key, mixed $data, boolean 2)
Methods
Constructor __construct (line 67)

Object constructor.

rcube_cache __construct (string $type, int $userid, [string $prefix = ''], [int $ttl = 0], [bool $packed = true])
  • string $type: Engine type ('db' or 'memcache' or 'apc')
  • int $userid: User identifier
  • string $prefix: Key name prefix
  • int $ttl: Expiration time of memcache/apc items in seconds (max.2592000)
  • bool $packed: Enables/disabled data serialization. It's possible to disable data serialization if you're sure stored data will be always a safe string
close (line 214)

Writes the cache back to the DB.

void close ()
expunge (line 196)

Remove cache records older than ttl

void expunge ()
get (line 99)

Returns cached value.

  • return: Cached value
mixed get (string $key)
  • string $key: Cache key name
read (line 130)

Returns cached value without storing it in internal memory.

  • return: Cached value
mixed read (string $key)
  • string $key: Cache key name
remove (line 162)

Clears the cache.

void remove ([string $key = null], [boolean $prefix_mode = false])
  • string $key: Cache key name or pattern
  • boolean $prefix_mode: Enable it to clear all keys starting with prefix specified in $key
set (line 115)

Sets (add/update) value in cache.

void set (string $key, mixed $data)
  • string $key: Cache key name
  • mixed $data: Cache data
write (line 149)

Sets (add/update) value in cache and immediately saves it in the backend, no internal memory will be used.

void write (string $key, mixed $data, boolean 2)
  • string $key: Cache key name
  • mixed $data: Cache data
  • boolean 2: True on success, False on failure

Documentation generated on Wed, 23 May 2012 16:40:48 +0200 by phpDocumentor 1.4.4