cvs: pear-core /PEAR Registry.php
| From: | Greg Beaver | Date: | Tue, 26 Oct 2004 19:19:00 +0000 |
| Subject: | cvs: pear-core /PEAR Registry.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-cvs+get-25258@lists.php.net to get a copy of this message | ||
cellog Tue Oct 26 15:19:00 2004 EDT
Modified files:
/pear-core/PEAR Registry.php
Log:
merge in Registry fix from PEAR_1_3 for #2370 each time lock() was called, a new
file handle was created, and it was never fclosed().
close file handles on unlock() now
http://cvs.php.net/diff.php/pear-core/PEAR/Registry.php?r1=1.76&r2=1.77&ty=u
Index: pear-core/PEAR/Registry.php
diff -u pear-core/PEAR/Registry.php:1.76 pear-core/PEAR/Registry.php:1.77
--- pear-core/PEAR/Registry.php:1.76 Thu Oct 21 18:23:19 2004
+++ pear-core/PEAR/Registry.php Tue Oct 26 15:18:59 2004
@@ -18,7 +18,7 @@
// | |
// +----------------------------------------------------------------------+
//
-// $Id: Registry.php,v 1.76 2004/10/21 22:23:19 cellog Exp $
+// $Id: Registry.php,v 1.77 2004/10/26 19:18:59 cellog Exp $
/*
TODO:
@@ -553,7 +553,9 @@
$open_mode = 'r';
}
- $this->lock_fp = @fopen($this->lockfile, $open_mode);
+ if (!is_resource($this->lock_fp)) {
+ $this->lock_fp = @fopen($this->lockfile, $open_mode);
+ }
if (!is_resource($this->lock_fp)) {
return $this->raiseError("could not create lock file" .
@@ -580,6 +582,9 @@
{
$ret = $this->_lock(LOCK_UN);
$this->lock_fp = null;
+ if (is_resource($this->lock_fp)) {
+ fclose($this->lock_fp);
+ }
return $ret;
}