From 172d92958f590d3957747e222cb718e2c611cdcf Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Wed, 28 Aug 2013 06:46:43 -0400 Subject: [PATCH] refactored code. --- framework/yii/caching/FileCache.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/framework/yii/caching/FileCache.php b/framework/yii/caching/FileCache.php index 54d6506..437a7be 100644 --- a/framework/yii/caching/FileCache.php +++ b/framework/yii/caching/FileCache.php @@ -71,11 +71,7 @@ class FileCache extends Cache public function exists($key) { $cacheFile = $this->getCacheFile($this->buildKey($key)); - if (($time = @filemtime($cacheFile)) > time()) { - return true; - } else { - return false; - } + return @filemtime($cacheFile) > time(); } /** @@ -87,7 +83,7 @@ class FileCache extends Cache protected function getValue($key) { $cacheFile = $this->getCacheFile($key); - if (($time = @filemtime($cacheFile)) > time()) { + if (@filemtime($cacheFile) > time()) { return @file_get_contents($cacheFile); } else { return false;