fix #385 object cache 정리 및 오류가 발생할 수 는 문제 해결

This commit is contained in:
bnu 2014-01-29 14:30:32 +09:00
parent 58e141c48a
commit d48d9d80a7
14 changed files with 175 additions and 167 deletions

View file

@ -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));
}