Merge pull request #1379 from kijin/fix/opcache-invalidate

PHP 5.5 이상에서 캐시파일 변경시 opcache_invalidate() 호출
This commit is contained in:
bnu 2015-05-19 14:26:39 +09:00
commit 2fe716b086

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