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() |
|---|
stringKey in the cache
stringto cache
arrayUse MEMCACHE_COMPRESSED to store the item compressed (uses zlib).
integerTime in seconds. Default = 604800 = one week
booleanTrue for successdelete(string $key) : boolean
get(string $key, integer $flags) : string
| see | \Memcache::get() |
|---|
stringKey in the cache
integerSee {@link http://php.net/manual/en/memcache.get.php}
stringgetInstance() : 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 |
|---|
objecthasServer() : boolean
Is the cache server this object uses available to be used by the system
| see | \DStructCacheInterface::hasServer() |
|---|
booleanhits() : 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() |
|---|
integermisses() : 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() |
|---|
integerset(string $key, string $var, integer $flags, integer $expire) : boolean
| see | \Memcache::set() |
|---|
stringKey in the cache
string
integerSee {@link http://php.net/manual/en/memcache.get.php}
integerTime in seconds. Default = 604800 = one week
booleanTRUE 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