\Alo\CacheAbstractCache

The abstract cache class

Summary

Methods
Properties
Constants
__construct()
is_available()
purge()
addServer()
getStats()
delete()
get()
getAll()
set()
deleteWithPrefix()
deleteWithSuffix()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct() 

Instantiates the class

is_available()

is_available() : boolean

Checks if a caching extension is available

Returns

boolean

purge()

purge() : boolean

Clears all items from cache

Returns

boolean

addServer()

addServer(string  $ip, string  $port, integer  $weight) : boolean

Adds a server to the pool

Parameters

string $ip

The server IP

string $port

The server port

integer $weight

The server's weight, ie how likely it is to be used

Returns

boolean

getStats()

getStats() : array

Gets cache process info

Returns

array

delete()

delete(string  $key) : boolean

Deletes a memcache key

Parameters

string $key

The key

Returns

boolean

get()

get(string  $id) : mixed

Gets a cached value

Parameters

string $id

The value's key

Returns

mixed

getAll()

getAll() : array

Return all cached keys and values

Returns

array

set()

set(string  $key, mixed  $var, integer  $expire = 3600) : boolean

Sets a cached key/value pair

Parameters

string $key

The key identifier

mixed $var

The value to set

integer $expire

When to expire the set data. Defaults to 3600s.

Returns

boolean

deleteWithPrefix()

deleteWithPrefix(string  $prefix) : \Alo\Cache\AbstractCache

Deletes all cached entries with the supplied prefix

Parameters

string $prefix

The prefix

Returns

\Alo\Cache\AbstractCache

deleteWithSuffix()

deleteWithSuffix(string  $suffix) : \Alo\Cache\AbstractCache

Deletes all cached entries with the supplied suffix

Parameters

string $suffix

The suffix

Returns

\Alo\Cache\AbstractCache