-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from brandonsavage/interface_update
Updating and adding methods to the Bouncer cache interface.
- Loading branch information
Showing
4 changed files
with
61 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
interface Cache_Interface { | ||
|
||
/** | ||
* Get an item from the cache, if it exists | ||
* @return mixed item if found, else false | ||
*/ | ||
public function get($key); | ||
|
||
/** | ||
* Store an item in the cache. Replaces an existing item. | ||
* @return bool success | ||
*/ | ||
public function set($key, $var, $flag = null, $expire); | ||
|
||
/** | ||
* Store an item in the cache. Returns false if the key is | ||
* already present in the cache. | ||
* @return bool success | ||
*/ | ||
public function add($key, $var, $flag = null, $expire); | ||
|
||
/** | ||
* Store an item in the cache. Returns false if the key did | ||
* NOT exist in the cache before. | ||
* @return bool success | ||
*/ | ||
public function replace($key, $var, $flag = null, $expire); | ||
|
||
/** | ||
* Close the connection to _ALL_ cache servers | ||
* @return bool success | ||
*/ | ||
public function close(); | ||
|
||
/** | ||
* Delete something off the cache | ||
* @return bool success | ||
*/ | ||
public function delete($key, $timeout = null); | ||
|
||
/** | ||
* Returns key in the appropriate namespace. | ||
* @param string $key memcache key | ||
* @return string Namespaced key | ||
*/ | ||
public function namespaceKey($key); | ||
|
||
/** | ||
* Flush the cache | ||
* @return bool success | ||
*/ | ||
public function flush(); | ||
|
||
} |
This file contains 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
This file contains 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
This file contains 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