Add abstract cache layer

This commit is contained in:
Frederic Guillot
2015-09-20 12:38:35 -04:00
parent 8079b5af64
commit fe57edd9e8
10 changed files with 383 additions and 93 deletions

View File

@@ -0,0 +1,45 @@
<?php
namespace Core\Cache;
/**
* Cache Interface
*
* @package cache
* @author Frederic Guillot
*/
interface CacheInterface
{
/**
* Save a new value in the cache
*
* @access public
* @param string $key
* @param string $value
*/
public function set($key, $value);
/**
* Fetch value from cache
*
* @access public
* @param string $key
* @return mixed Null when not found, cached value otherwise
*/
public function get($key);
/**
* Clear all cache
*
* @access public
*/
public function flush();
/**
* Remove cached value
*
* @access public
* @param string $key
*/
public function remove($key);
}