Fixed a bug that CFileCache may slow down performance when strlen is overloaded by mb_strlen

This commit is contained in:
qiang.xue
2010-11-12 01:53:28 +00:00
parent 1e92a280d7
commit bffe7c1c8f
2 changed files with 2 additions and 1 deletions

View File

@@ -134,7 +134,7 @@ class CFileCache extends CCache
$cacheFile=$this->getCacheFile($key);
if($this->directoryLevel>0)
@mkdir(dirname($cacheFile),0777,true);
if(@file_put_contents($cacheFile,$value,LOCK_EX)==strlen($value))
if(@file_put_contents($cacheFile,$value,LOCK_EX)!==false)
{
@chmod($cacheFile,0777);
return @touch($cacheFile,$expire);