Class rcube_cache

Description

Interface class for accessing Roundcube cache

Located in /lib/Roundcube/rcube_cache.php (line 30)


	
			
Method Summary
 rcube_cache __construct (string $type, int $userid, [string $prefix = ''], [string $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 60)

Object constructor.

rcube_cache __construct (string $type, int $userid, [string $prefix = ''], [string $ttl = 0], [bool $packed = true])
  • string $type: Engine type ('db' or 'memcache' or 'apc')
  • int $userid: User identifier
  • string $prefix: Key name prefix
  • string $ttl: Expiration time of memcache/apc items
  • 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 211)

Writes the cache back to the DB.

void close ()
expunge (line 193)

Remove cache records older than ttl

void expunge ()
get (line 96)

Returns cached value.

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

Returns cached value without storing it in internal memory.

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

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 112)

Sets (add/update) value in cache.

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

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 Fri, 03 May 2013 12:44:58 +0200 by phpDocumentor 1.4.4