mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Merge #1802 $modified_timed -> $modified_time by qkrcjfgus33
* pr/1802: $modified_timed -> $modified_time
This commit is contained in:
commit
9b341a85b8
1 changed files with 25 additions and 25 deletions
50
classes/cache/CacheFile.class.php
vendored
50
classes/cache/CacheFile.class.php
vendored
|
|
@ -6,7 +6,7 @@
|
|||
*
|
||||
* Filedisk Cache Handler
|
||||
*
|
||||
* @author NAVER (developers@xpressengine.com)
|
||||
* @author NAVER (developers@xpressengine.com)
|
||||
*/
|
||||
class CacheFile extends CacheBase
|
||||
{
|
||||
|
|
@ -78,10 +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);
|
||||
}
|
||||
if(function_exists('opcache_invalidate'))
|
||||
{
|
||||
@opcache_invalidate($cache_file, true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -94,15 +94,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;
|
||||
}
|
||||
|
||||
if($modified_time > 0 && filemtime($cache_file) < $modified_time)
|
||||
{
|
||||
FileHandler::removeFile($cache_file);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -118,19 +118,19 @@ class CacheFile extends CacheBase
|
|||
*/
|
||||
function get($key, $modified_time = 0)
|
||||
{
|
||||
if(!$cache_file = FileHandler::exists($this->getCacheFileName($key)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if($modified_time > 0 && filemtime($cache_file) < $modified_timed)
|
||||
if(!$cache_file = FileHandler::exists($this->getCacheFileName($key)))
|
||||
{
|
||||
FileHandler::removeFile($cache_file);
|
||||
return false;
|
||||
}
|
||||
|
||||
$content = include($cache_file);
|
||||
|
||||
if($modified_time > 0 && filemtime($cache_file) < $modified_time)
|
||||
{
|
||||
FileHandler::removeFile($cache_file);
|
||||
return false;
|
||||
}
|
||||
|
||||
$content = include($cache_file);
|
||||
|
||||
return unserialize(stripslashes($content));
|
||||
}
|
||||
|
||||
|
|
@ -143,10 +143,10 @@ class CacheFile extends CacheBase
|
|||
function _delete($_key)
|
||||
{
|
||||
$cache_file = $this->getCacheFileName($_key);
|
||||
if(function_exists('opcache_invalidate'))
|
||||
{
|
||||
@opcache_invalidate($cache_file, true);
|
||||
}
|
||||
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