Provides consistant caching interface.
Cache objects can extend this interface and be used by the system or by users in their scripts. Objects should be Singletons
author | David Lidstone |
---|---|
package | dstruct_common |
add(string $key, mixed $var, integer $expire) : boolean
string
mixed
integer
Time the data is valid for in seconds
boolean
TRUE if value was actually added, FALSE if otherwisedelete(string $key) : boolean
string
boolean
get(string $key) : mixed
string
mixed
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
object
hasServer() : boolean
Is the cache server this object uses available to be used by the system
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.
integer
misses()
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.
set(string $key, mixed $var, integer $expire) : boolean
string
mixed
integer
Time the data is valid for in seconds
boolean
TRUE if value was actually added, FALSE if otherwisewrites()
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.