-
Notifications
You must be signed in to change notification settings - Fork 10
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 #2 from M6Web/feature/cache
- Loading branch information
Showing
10 changed files
with
645 additions
and
23 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
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,51 @@ | ||
<?php | ||
namespace M6Web\Bundle\GuzzleHttpBundle\Cache; | ||
|
||
/** | ||
* Interface for the cache system on guzzlehttp client | ||
*/ | ||
interface CacheInterface | ||
{ | ||
/** | ||
* Checks if the cache has a value for a key. | ||
* | ||
* @param string $key A unique key | ||
* | ||
* @return Boolean Whether the cache has a value for this key | ||
*/ | ||
public function has($key); | ||
|
||
/** | ||
* Returns the value for a key. | ||
* | ||
* @param string $key A unique key | ||
* | ||
* @return string|null The value in the cache | ||
*/ | ||
public function get($key); | ||
|
||
/** | ||
* Sets a value in the cache. | ||
* | ||
* @param string $key A unique key | ||
* @param string $value The value to cache | ||
* @param integer $ttl Time to live in seconds | ||
*/ | ||
public function set($key, $value, $ttl = null); | ||
|
||
/** | ||
* Removes a value from the cache. | ||
* | ||
* @param string $key A unique key | ||
*/ | ||
public function remove($key); | ||
|
||
/** | ||
* Return the TTL in second of a cache key or false if key doesn't exist | ||
* | ||
* @param string $key The key | ||
* | ||
* @return integer|false the ttl or false | ||
*/ | ||
public function ttl($key); | ||
} |
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
Oops, something went wrong.