#242 cache key에 xe core 버전명을 prefix로 사용.

This commit is contained in:
bnu 2014-01-01 00:22:36 +09:00
parent 60ef5e1bab
commit 21057ca527
5 changed files with 21 additions and 30 deletions

View file

@ -8,13 +8,6 @@
* */
class CacheApc extends CacheBase
{
/**
* Default valid time
* @var int
*/
var $valid_time = 36000;
/**
* Get instance of CacheApc
*

View file

@ -10,13 +10,6 @@
*/
class CacheFile extends CacheBase
{
/**
* Default valid time
* @var int
*/
var $valid_time = 36000;
/**
* Path that value to stored
* @var string
@ -56,7 +49,7 @@ class CacheFile extends CacheBase
*/
function getCacheFileName($key)
{
return $this->cache_dir . str_replace(':', '_', $key);
return $this->cache_dir . str_replace(':', '_', $key);
}
/**

View file

@ -8,7 +8,6 @@
*/
class CacheHandler extends Handler
{
/**
* instance of cache handler
* @var CacheBase
@ -129,6 +128,17 @@ class CacheHandler extends Handler
return false;
}
/**
* Get cache name by key
*
* @param string $key The key that will be associated with the item.
* @return string Returns cache name
*/
function getCacheKey($key)
{
return __XE_VERSION__ . ':' . $key;
}
/**
* Get cached data
*
@ -139,6 +149,7 @@ class CacheHandler extends Handler
*/
function get($key, $modified_time = 0)
{
$key = $this->getCacheKey($key);
if(!$this->handler)
{
return false;
@ -158,6 +169,7 @@ class CacheHandler extends Handler
*/
function put($key, $obj, $valid_time = 0)
{
$key = $this->getCacheKey($key);
if(!$this->handler)
{
return false;
@ -173,6 +185,7 @@ class CacheHandler extends Handler
*/
function delete($key)
{
$key = $this->getCacheKey($key);
if(!$this->handler)
{
return false;
@ -190,6 +203,7 @@ class CacheHandler extends Handler
*/
function isValid($key, $modified_time)
{
$key = $this->getCacheKey($key);
if(!$this->handler)
{
return false;
@ -259,6 +273,11 @@ class CacheHandler extends Handler
*/
class CacheBase
{
/**
* Default valid time
* @var int
*/
var $valid_time = 36000;
/**
* Get cached data

View file

@ -8,13 +8,6 @@
*/
class CacheMemcache extends CacheBase
{
/**
* Default valid time
* @var int
*/
var $valid_time = 36000;
/**
* instance of Memcahe
* @var Memcahe

View file

@ -10,13 +10,6 @@
*/
class CacheWincache extends CacheBase
{
/**
* Default valid time
* @var int
*/
var $valid_time = 36000;
/**
* Get instance of CacheWincache
*