Memcache-based caching class.
2009.10.10
2006-2009 LifeNexus Digital, Inc., and contributors.
| Simplified BSD License | http://opensource.org/licenses/bsd-license.php |
| CacheCore | http://cachecore.googlecode.com |
| CloudFusion | http://getcloudfusion.com |
| Memcache | http://php.net/memcache |
Container for all Memcache-based cache methods. Inherits additional methods from CacheCore. Adheres to the ICacheCore interface.
Holds the Memcache object.
public function __construct( $name, $location, $expires, $gzip = true )
The constructor
public
| name | string (Required) A name to uniquely identify the cache object. |
| location | string (Required) The location to store the cache object in. This may vary by cache method. |
| expires | integer (Required) The number of seconds until a cache object is considered stale. |
| gzip | boolean (Optional) Whether data should be gzipped before being stored. Defaults to true. |
object Reference to the cache object.
public function create( $data )
Creates a new cache.
public
| data | mixed (Required) The data to cache. |
boolean Whether the operation was successful.
public function read()
Reads a cache.
public
mixed Either the content of the cache object, or boolean false.
public function update( $data )
Updates an existing cache.
public
| data | mixed (Required) The data to cache. |
boolean Whether the operation was successful.
public function delete()
Deletes a cache.
public
boolean Whether the operation was successful.
public function is_expired()
Defined here, but always returns false. Memcache manages it’s own expirations.
public
boolean Whether the cache is expired or not.
public function timestamp()
Implemented here, but always returns false. Memcache manages it’s own expirations.
public
mixed Either the Unix time stamp of the cache creation, or boolean false.
public function reset()
Implemented here, but always returns false. Memcache manages it’s own expirations.
public
boolean Whether the operation was successful.