Wraps PHP's MemCache class.
Wrapping MemCache gives a consistent object as defined by DStructCacheInterface.
package | dstruct_common |
---|
add(string $key, string $var, array $flags, integer $expire) : boolean
Will add an entry if $key does not already exist.
see | \Memcache::add() |
---|
string
Key in the cache
string
to cache
array
Use MEMCACHE_COMPRESSED to store the item compressed (uses zlib).
integer
Time in seconds. Default = 604800 = one week
boolean
True for successdelete(string $key) : boolean
get(string $key, integer $flags) : string
see | \Memcache::get() |
---|
string
Key in the cache
integer
See {@link http://php.net/manual/en/memcache.get.php}
string
getInstance() : object
Objects are singletons and so use this method to get an instance. If you impliment this interface, it is recommended that you declare the __constructor() as protected
todo | rewrite to handle pools |
---|
object
hasServer() : boolean
Is the cache server this object uses available to be used by the system
see | \DStructCacheInterface::hasServer() |
---|
boolean
hits() : integer
Not persistent. Counts the number of times this cache object has been queried and returned existing data. Please check the documentation for each classes implimentation of this method, as the functionallity may vary across classes.
see | \DStructCacheInterface::hits() |
---|
integer
misses() : integer
Not persistent. Counts the number of times this cache object has been queried but had no data for that key. Please check the documentation for each classes implimentation of this method, as the functionallity may vary across classes.
see | \DStructCacheInterface::misses() |
---|
integer
set(string $key, string $var, integer $flags, integer $expire) : boolean
see | \Memcache::set() |
---|
string
Key in the cache
string
integer
See {@link http://php.net/manual/en/memcache.get.php}
integer
Time in seconds. Default = 604800 = one week
boolean
TRUE if value was actually added, FALSE if otherwisewrites() : integer
Not persistent. Counts the number of times this cache object has been written to. Please check the documentation for each classes implimentation of this method, as the functionallity may vary across classes.
see | \DStructCacheInterface::writes() |
---|
integer
__construct()
todo | Check connecting to servers works as expected (what is returned when adding server). |
---|
$failedwrites : integer
$hasserver : boolean
$hits : integer
$instance : object
$misses : integer
$writes : integer