protected function writeAndRelease($handle, $content, $rewrite = false)
    {
        $rewrite && rewind($handle) && ftruncate($handle, 0);
        $result = fwrite($handle, $content);
        flock($handle, LOCK_UN);
        fclose($handle);
        return (bool) $result;
    }
protected function writeAndRelease($handle, $content, $rewrite = false)
    {
        $rewrite && rewind($handle) && ftruncate($handle, 0);
        $result = fwrite($handle, $content);
        flock($handle, LOCK_UN);
        fclose($handle);
        return (bool) $result;
    }
protected function writeAndRelease ( $ handle , $ content , $ rewrite = false ) { $ rewrite && rewind ( $ handle ) && ftruncate ( $ handle , 0 ) ; $ result = fwrite ( $ handle , $ content ) ; flock ( $ handle , LOCK_UN ) ; fclose ( $ handle ) ; return ( bool ) $ result ; }
Write content, release lock and close file

@param  resource $handle  file handle
@param  string   $content the value of cache
@param  bool     $rewrite whether rewrite the whole file
@return boolean
Write content release lock and close file