cvs: pear /Cache_Lite Cache_Lite.php

From: Date: Sat, 10 Aug 2002 09:22:13 +0000
Subject: cvs: pear /Cache_Lite Cache_Lite.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-5656@lists.php.net to get a copy of this message
fab Sat Aug 10 05:22:13 2002 EDT Modified files: /pear/Cache_Lite Cache_Lite.php Log: Add some '@' to avoid warnings in a few cases of cache corruption Index: pear/Cache_Lite/Cache_Lite.php diff -u pear/Cache_Lite/Cache_Lite.php:1.6 pear/Cache_Lite/Cache_Lite.php:1.7 --- pear/Cache_Lite/Cache_Lite.php:1.6 Thu Aug 8 16:28:19 2002 +++ pear/Cache_Lite/Cache_Lite.php Sat Aug 10 05:22:13 2002 @@ -10,7 +10,7 @@ * There are some examples in the 'docs/examples' file * Technical choices are described in the 'docs/technical' file * -* @version $Id: Cache_Lite.php,v 1.6 2002/08/08 20:28:19 fab Exp $ +* @version $Id: Cache_Lite.php,v 1.7 2002/08/10 09:22:13 fab Exp $ * @author Fabien MARTY <fab@php.net> */ @@ -291,16 +291,16 @@ function _read() { $fp = @fopen($this->_file, "r"); - if ($this->_fileLocking) flock($fp, LOCK_SH); + if ($this->_fileLocking) @flock($fp, LOCK_SH); if ($fp) { - $length = filesize($this->_file); + $length = @filesize($this->_file); if ($this->_readControl) { - $hashControl = fread($fp, 32); + $hashControl = @fread($fp, 32); $length = $length - 32; } - $data = fread($fp, $length); - if ($this->_fileLocking) flock($fp, LOCK_UN); - fclose($fp); + $data = @fread($fp, $length); + if ($this->_fileLocking) @flock($fp, LOCK_UN); + @fclose($fp); if ($this->_readControl) { $hashData = $this->_hash($data, $this->_readControlType); if ($hashData != $hashControl) { @@ -326,13 +326,13 @@ $fp = @fopen($this->_file, "w"); if ($fp) { $len = strlen($data); - if ($this->_fileLocking) flock($fp, LOCK_EX); + if ($this->_fileLocking) @flock($fp, LOCK_EX); if ($this->_readControl) { - fwrite($fp, $this->_hash($data, $this->_readControlType), 32); + @fwrite($fp, $this->_hash($data, $this->_readControlType), 32); } - fwrite($fp, $data, $len); - if ($this->_fileLocking) flock($fp, LOCK_UN); - fclose($fp); + @fwrite($fp, $data, $len); + if ($this->_fileLocking) @flock($fp, LOCK_UN); + @fclose($fp); return true; } Cache_Lite::_raiseError('Cache_Lite : Unable to write cache !', -1);

« previous php.pear.cvs (#5656) next »