mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
#242 cache key에 xe core 버전명을 prefix로 사용.
This commit is contained in:
parent
60ef5e1bab
commit
21057ca527
5 changed files with 21 additions and 30 deletions
7
classes/cache/CacheApc.class.php
vendored
7
classes/cache/CacheApc.class.php
vendored
|
|
@ -8,13 +8,6 @@
|
|||
* */
|
||||
class CacheApc extends CacheBase
|
||||
{
|
||||
|
||||
/**
|
||||
* Default valid time
|
||||
* @var int
|
||||
*/
|
||||
var $valid_time = 36000;
|
||||
|
||||
/**
|
||||
* Get instance of CacheApc
|
||||
*
|
||||
|
|
|
|||
9
classes/cache/CacheFile.class.php
vendored
9
classes/cache/CacheFile.class.php
vendored
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
21
classes/cache/CacheHandler.class.php
vendored
21
classes/cache/CacheHandler.class.php
vendored
|
|
@ -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
|
||||
|
|
|
|||
7
classes/cache/CacheMemcache.class.php
vendored
7
classes/cache/CacheMemcache.class.php
vendored
|
|
@ -8,13 +8,6 @@
|
|||
*/
|
||||
class CacheMemcache extends CacheBase
|
||||
{
|
||||
|
||||
/**
|
||||
* Default valid time
|
||||
* @var int
|
||||
*/
|
||||
var $valid_time = 36000;
|
||||
|
||||
/**
|
||||
* instance of Memcahe
|
||||
* @var Memcahe
|
||||
|
|
|
|||
7
classes/cache/CacheWincache.class.php
vendored
7
classes/cache/CacheWincache.class.php
vendored
|
|
@ -10,13 +10,6 @@
|
|||
*/
|
||||
class CacheWincache extends CacheBase
|
||||
{
|
||||
|
||||
/**
|
||||
* Default valid time
|
||||
* @var int
|
||||
*/
|
||||
var $valid_time = 36000;
|
||||
|
||||
/**
|
||||
* Get instance of CacheWincache
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue