Core functionality and default settings shared across caching classes.
2008.11.30
2006-2008 LifeNexus Digital, Inc., and contributors.
| Simplified BSD License | http://opensource.org/licenses/bsd-license.php |
| Tarzan | http://tarzan-aws.com |
public function __construct( $name, $location, $expires )
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. |
object Reference to the cache object.
| Example Usage | http://tarzan-aws.com |
public function create( $data )
Creates a new cache. Placeholder method should be defined by the extending class.
public
| data | mixed (Required) The data to cache. |
void
| Example Usage | http://tarzan-aws.com |
public function read()
Reads a cache. Placeholder method should be defined by the extending class.
public
void
| Example Usage | http://tarzan-aws.com |
public function update( $data )
Updates an existing cache. Placeholder method should be defined by the extending class.
public
| data | mixed (Required) The data to cache. |
void
| Example Usage | http://tarzan-aws.com |
public function reset()
Resets the freshness of the cache. Placeholder method should be defined by the extending class.
public
void
| Example Usage | http://tarzan-aws.com |
public function is_expired()
Checks whether the cache object is expired or not. Placeholder method should be defined by the extending class.
public
boolean Whether the cache is expired or not.
| Example Usage | http://tarzan-aws.com |
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.
| Example Usage | http://tarzan-aws.com |