mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 14:26:54 +08:00
Better implementation of FileCache::getValue()
This commit is contained in:
@ -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;
|
||||||
|
Reference in New Issue
Block a user