Created
January 16, 2013 04:43
-
-
Save AmyStephen/4544692 to your computer and use it in GitHub Desktop.
Simple Cache Interface
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface Cache | |
{ | |
/** | |
* Does cache exist for the key? | |
* | |
* @param string $key Key value used to store cache | |
* | |
* @return bool | |
*/ | |
public function exists($key); | |
/** | |
* Get cache for the key | |
* | |
* @param string $key Key value used to store cache | |
* | |
* @return mixed | |
*/ | |
public function get($key); | |
/** | |
* Remove cache entry for the specified key | |
* | |
* @param string $key Key value used to store cache | |
* | |
* @return bool | |
*/ | |
public function delete($key); | |
/** | |
* Save data in cache using the key value provided | |
* | |
* @param string $key Key value for the cache entry | |
* @param mixed $data Value to store as a cache entry | |
* @param int $ttl Time To live in seconds | |
* | |
* @return bool | |
*/ | |
public function put($key, $value, $ttl = 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment