PHP 5.5 이상에서 캐시파일 변경시 opcache_invalidate() 호출

This commit is contained in:
Kijin Sung 2015-04-08 10:38:59 +09:00
parent f4f15e4a39
commit 169e950e62

View file

@ -78,6 +78,10 @@ class CacheFile extends CacheBase
$content[] = 'if(!defined(\'__XE__\')) { exit(); }';
$content[] = 'return \'' . addslashes(serialize($obj)) . '\';';
FileHandler::writeFile($cache_file, implode(PHP_EOL, $content));
if(function_exists('opcache_invalidate'))
{
@opcache_invalidate($cache_file, true);
}
}
/**
@ -139,6 +143,10 @@ class CacheFile extends CacheBase
function _delete($_key)
{
$cache_file = $this->getCacheFileName($_key);
if(function_exists('opcache_invalidate'))
{
@opcache_invalidate($cache_file, true);
}
FileHandler::removeFile($cache_file);
}