mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
fix #385 object cache 정리 및 오류가 발생할 수 는 문제 해결
This commit is contained in:
parent
58e141c48a
commit
d48d9d80a7
14 changed files with 175 additions and 167 deletions
9
classes/cache/CacheApc.class.php
vendored
9
classes/cache/CacheApc.class.php
vendored
|
|
@ -8,6 +8,8 @@
|
|||
* */
|
||||
class CacheApc extends CacheBase
|
||||
{
|
||||
public static $isSupport = false;
|
||||
|
||||
/**
|
||||
* Get instance of CacheApc
|
||||
*
|
||||
|
|
@ -30,7 +32,6 @@ class CacheApc extends CacheBase
|
|||
*/
|
||||
function CacheApc()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -40,7 +41,7 @@ class CacheApc extends CacheBase
|
|||
*/
|
||||
function isSupport()
|
||||
{
|
||||
return function_exists('apc_add');
|
||||
return self::$isSupport;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -148,6 +149,10 @@ class CacheApc extends CacheBase
|
|||
return apc_clear_cache('user');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
CacheApc::$isSupport = function_exists('apc_add');
|
||||
|
||||
/* End of file CacheApc.class.php */
|
||||
/* Location: ./classes/cache/CacheApc.class.php */
|
||||
|
|
|
|||
21
classes/cache/CacheFile.class.php
vendored
21
classes/cache/CacheFile.class.php
vendored
|
|
@ -6,7 +6,7 @@
|
|||
*
|
||||
* Filedisk Cache Handler
|
||||
*
|
||||
* @author Arnia Software (xe_dev@arnia.ro)
|
||||
* @author NAVER (developers@xpressengine.com)
|
||||
*/
|
||||
class CacheFile extends CacheBase
|
||||
{
|
||||
|
|
@ -90,8 +90,15 @@ class CacheFile extends CacheBase
|
|||
function isValid($key, $modified_time = 0)
|
||||
{
|
||||
$cache_file = $this->getCacheFileName($key);
|
||||
|
||||
if(file_exists($cache_file))
|
||||
{
|
||||
if($modified_time > 0 && filemtime($cache_file) < $modified_timed)
|
||||
{
|
||||
FileHandler::removeFile($cache_file);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -107,15 +114,19 @@ class CacheFile extends CacheBase
|
|||
*/
|
||||
function get($key, $modified_time = 0)
|
||||
{
|
||||
$cache_file = FileHandler::exists($this->getCacheFileName($key));
|
||||
if(!$cache_file = FileHandler::exists($this->getCacheFileName($key)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if($cache_file) $content = include($cache_file);
|
||||
|
||||
if(!$content)
|
||||
if($modified_time > 0 && filemtime($cache_file) < $modified_timed)
|
||||
{
|
||||
FileHandler::removeFile($cache_file);
|
||||
return false;
|
||||
}
|
||||
|
||||
$content = include($cache_file);
|
||||
|
||||
return unserialize(stripslashes($content));
|
||||
}
|
||||
|
||||
|
|
|
|||
4
classes/cache/CacheMemcache.class.php
vendored
4
classes/cache/CacheMemcache.class.php
vendored
|
|
@ -56,10 +56,11 @@ class CacheMemcache extends CacheBase
|
|||
*/
|
||||
function isSupport()
|
||||
{
|
||||
if($GLOBALS['XE_MEMCACHE_SUPPORT'])
|
||||
if(isset($GLOBALS['XE_MEMCACHE_SUPPORT']))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if($this->Memcache->set('xe', 'xe', MEMCACHE_COMPRESSED, 1))
|
||||
{
|
||||
$GLOBALS['XE_MEMCACHE_SUPPORT'] = true;
|
||||
|
|
@ -68,6 +69,7 @@ class CacheMemcache extends CacheBase
|
|||
{
|
||||
$GLOBALS['XE_MEMCACHE_SUPPORT'] = false;
|
||||
}
|
||||
|
||||
return $GLOBALS['XE_MEMCACHE_SUPPORT'];
|
||||
}
|
||||
|
||||
|
|
|
|||
8
classes/cache/CacheWincache.class.php
vendored
8
classes/cache/CacheWincache.class.php
vendored
|
|
@ -10,6 +10,8 @@
|
|||
*/
|
||||
class CacheWincache extends CacheBase
|
||||
{
|
||||
public static $isSupport = false;
|
||||
|
||||
/**
|
||||
* Get instance of CacheWincache
|
||||
*
|
||||
|
|
@ -32,7 +34,6 @@ class CacheWincache extends CacheBase
|
|||
*/
|
||||
function CacheWincache()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -42,7 +43,7 @@ class CacheWincache extends CacheBase
|
|||
*/
|
||||
function isSupport()
|
||||
{
|
||||
return function_exists('wincache_ucache_set');
|
||||
return self::$isSupport;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -150,7 +151,8 @@ class CacheWincache extends CacheBase
|
|||
{
|
||||
return wincache_ucache_clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
CacheWincache::$isSupport = function_exists('wincache_ucache_set');
|
||||
/* End of file CacheWincache.class.php */
|
||||
/* Location: ./classes/cache/CacheWincache.class.php */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue