mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-30 16:49:58 +09:00
#242 cache key에 xe core 버전명을 prefix로 사용.
This commit is contained in:
parent
2149ed7700
commit
d2365bbd09
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
|
class CacheApc extends CacheBase
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
|
||||||
* Default valid time
|
|
||||||
* @var int
|
|
||||||
*/
|
|
||||||
var $valid_time = 36000;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get instance of CacheApc
|
* 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
|
class CacheFile extends CacheBase
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
|
||||||
* Default valid time
|
|
||||||
* @var int
|
|
||||||
*/
|
|
||||||
var $valid_time = 36000;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Path that value to stored
|
* Path that value to stored
|
||||||
* @var string
|
* @var string
|
||||||
|
|
@ -56,7 +49,7 @@ class CacheFile extends CacheBase
|
||||||
*/
|
*/
|
||||||
function getCacheFileName($key)
|
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
|
class CacheHandler extends Handler
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* instance of cache handler
|
* instance of cache handler
|
||||||
* @var CacheBase
|
* @var CacheBase
|
||||||
|
|
@ -129,6 +128,17 @@ class CacheHandler extends Handler
|
||||||
return false;
|
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
|
* Get cached data
|
||||||
*
|
*
|
||||||
|
|
@ -139,6 +149,7 @@ class CacheHandler extends Handler
|
||||||
*/
|
*/
|
||||||
function get($key, $modified_time = 0)
|
function get($key, $modified_time = 0)
|
||||||
{
|
{
|
||||||
|
$key = $this->getCacheKey($key);
|
||||||
if(!$this->handler)
|
if(!$this->handler)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -158,6 +169,7 @@ class CacheHandler extends Handler
|
||||||
*/
|
*/
|
||||||
function put($key, $obj, $valid_time = 0)
|
function put($key, $obj, $valid_time = 0)
|
||||||
{
|
{
|
||||||
|
$key = $this->getCacheKey($key);
|
||||||
if(!$this->handler)
|
if(!$this->handler)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -173,6 +185,7 @@ class CacheHandler extends Handler
|
||||||
*/
|
*/
|
||||||
function delete($key)
|
function delete($key)
|
||||||
{
|
{
|
||||||
|
$key = $this->getCacheKey($key);
|
||||||
if(!$this->handler)
|
if(!$this->handler)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -190,6 +203,7 @@ class CacheHandler extends Handler
|
||||||
*/
|
*/
|
||||||
function isValid($key, $modified_time)
|
function isValid($key, $modified_time)
|
||||||
{
|
{
|
||||||
|
$key = $this->getCacheKey($key);
|
||||||
if(!$this->handler)
|
if(!$this->handler)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -259,6 +273,11 @@ class CacheHandler extends Handler
|
||||||
*/
|
*/
|
||||||
class CacheBase
|
class CacheBase
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Default valid time
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
var $valid_time = 36000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get cached data
|
* 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
|
class CacheMemcache extends CacheBase
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
|
||||||
* Default valid time
|
|
||||||
* @var int
|
|
||||||
*/
|
|
||||||
var $valid_time = 36000;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* instance of Memcahe
|
* instance of Memcahe
|
||||||
* @var 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
|
class CacheWincache extends CacheBase
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
|
||||||
* Default valid time
|
|
||||||
* @var int
|
|
||||||
*/
|
|
||||||
var $valid_time = 36000;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get instance of CacheWincache
|
* Get instance of CacheWincache
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue