Core functionality and default settings shared across caching classes.
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 |
Container for all shared caching methods. This is not intended to be instantiated directly, but is extended by the cache-specific classes.
A name to uniquely identify the cache object by.
Where to store the cache.
The number of seconds before a cache object is considered stale.
Used internally to uniquely identify the location + name of the cache object.
Stores the time when the cache object was created.
Stores whether or not the content should be gzipped when stored
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 response_manager( $callback, $params = null )
Provides a simple, straightforward cache-logic mechanism. Useful for non-complex response caches.
public
| callback | string (Required) The name of the function to fire when we need to fetch new data to cache. |
| params | array (Optional) Parameters to pass into the callback function, as an array. |
array The cached data being requested.