mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 18:51: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
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue