mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
PHP 5.5 이상에서 캐시파일 변경시 opcache_invalidate() 호출
This commit is contained in:
parent
f4f15e4a39
commit
169e950e62
1 changed files with 8 additions and 0 deletions
8
classes/cache/CacheFile.class.php
vendored
8
classes/cache/CacheFile.class.php
vendored
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue