MAX_EXP_LEVEL
MAX_EXP_LEVEL = 2
Interface class for accessing Roundcube cache
factory(string $type, int $userid, string $prefix = '', string $ttl, bool $packed = true, bool $indexed = false) : \rcube_cache
Object factory
| string | $type | Engine type ('db', 'memcache', 'apc', 'redis') |
| 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 |
| bool | $indexed | Use indexed cache. Indexed cache is more appropriate for storing big data with possibility to remove it by a key prefix. Non-indexed cache does not remove data, but flags it for expiration, also stores it in memory until close() method is called. |
Cache object
__construct(int $userid, string $prefix = '', string $ttl, bool $packed = true, bool $indexed = false) : mixed
Object constructor.
| 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 |
| bool | $indexed | Use indexed cache. Indexed cache is more appropriate for storing big data with possibility to remove it by key prefix. Non-indexed cache does not remove data, but flags it for expiration, also stores it in memory until close() method is called. |
| None found |
remove(string $key = null, bool $prefix_mode = false) : mixed
Clears the cache.
| string | $key | Cache key name or pattern |
| bool | $prefix_mode | Enable it to clear all keys starting with prefix specified in $key |
| None found |
| None found |
| None found |
| None found |
key_name(string $prefix, array $params = []) : string
A helper to build cache key for specified parameters.
| string | $prefix | Key prefix (Max. length 64 characters) |
| array | $params | Additional parameters |
Key name
| None found |
read_record(string $key) : mixed
Reads cache entry.
| string | $key | Cache key name |
Cached value
| None found |
write_record(string $key, mixed $data) : bool
Writes single cache record into DB.
| string | $key | Cache key name |
| mixed | $data | Serialized cache data |
True on success, False on failure
| None found |
remove_record(string $key = null, bool $prefix_mode = false) : mixed
Deletes the cache record(s).
| string | $key | Cache key name or pattern |
| bool | $prefix_mode | Enable it to clear all keys starting with prefix specified in $key |
| None found |
remove_record_indexed(mixed $key = null, mixed $prefix_mode = false) : mixed
| mixed | $key | |
| mixed | $prefix_mode |
| None found |
write_index(mixed $force = null) : mixed
Writes the index entry as well as updated entries into memcache/apc/redis DB.
| mixed | $force |
| None found |
| None found |
store_record(mixed $key, mixed $data, mixed $ts = null) : mixed
Write data entry into cache
| mixed | $key | |
| mixed | $data | |
| mixed | $ts |
| None found |
get_item(string $key) : mixed
Fetches cache entry.
| string | $key | Cache internal key name |
Cached value
| None found |
add_item(string $key, mixed $data) : bool
Adds entry into memcache/apc/redis DB.
| string | $key | Cache internal key name |
| mixed | $data | Serialized cache data |
True on success, False on failure
| None found |
delete_item(string $key) : bool
Deletes entry from memcache/apc/redis DB.
| string | $key | Cache internal key name |
True on success, False on failure
| None found |
get_exp_timestamp(mixed $key) : mixed
Get EXP:<key> record value from cache
| mixed | $key |
| None found |
ikey() : string
Creates per-user index cache key name (for memcache, apc, redis)
Cache key
| None found |
ckey(string $key) : string
Creates per-user cache key name (for memcache, apc, redis)
| string | $key | Cache key name |
Cache key
| None found |
ekey(string $key, mixed $prefix = null) : string
Creates per-user cache key name for expiration time entry
| string | $key | Cache key name |
| mixed | $prefix |
Cache key
| None found |
serialize(mixed $data) : mixed
Serializes data for storing
| mixed | $data |
| None found |
unserialize(mixed $data) : mixed
Unserializes serialized data
| mixed | $data |
| None found |
max_packet_size() : mixed
Determine the maximum size for cache data to be written
| None found |
debug(mixed $type, mixed $key, mixed $data = null, mixed $result = null) : mixed
Write memcache/apc/redis debug info to the log
| mixed | $type | |
| mixed | $key | |
| mixed | $data | |
| mixed | $result |
| None found |