Better implementation of FileCache::getValue()

This commit is contained in:
Alexander Makarov
2015-07-13 00:45:55 +03:00
parent a3e5a3151c
commit 251c316977

View File

@ -112,7 +112,7 @@ class FileCache extends Cache
$fp = @fopen($cacheFile, 'r'); $fp = @fopen($cacheFile, 'r');
if ($fp !== false) { if ($fp !== false) {
@flock($fp, LOCK_SH); @flock($fp, LOCK_SH);
$cacheValue = @file_get_contents($cacheFile); $cacheValue = @stream_get_contents($fp);
@flock($fp, LOCK_UN); @flock($fp, LOCK_UN);
@fclose($fp); @fclose($fp);
return $cacheValue; return $cacheValue;