cvs: php4 /pear/PEAR Registry.php

From: Date: Tue, 09 Apr 2002 13:11:53 +0000
Subject: cvs: php4 /pear/PEAR Registry.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-3181@lists.php.net to get a copy of this message
cox Tue Apr 9 09:11:53 2002 EDT Modified files: /php4/pear/PEAR Registry.php Log: Fix a problem when list-installed is called in a new installation Index: php4/pear/PEAR/Registry.php diff -u php4/pear/PEAR/Registry.php:1.23 php4/pear/PEAR/Registry.php:1.24 --- php4/pear/PEAR/Registry.php:1.23 Tue Apr 2 04:18:07 2002 +++ php4/pear/PEAR/Registry.php Tue Apr 9 09:11:51 2002 @@ -16,7 +16,7 @@ // | Author: Stig Bakken <ssb@fast.no> | // +----------------------------------------------------------------------+ // -// $Id: Registry.php,v 1.23 2002/04/02 09:18:07 ssb Exp $ +// $Id: Registry.php,v 1.24 2002/04/09 13:11:51 cox Exp $ require_once "System.php"; require_once "PEAR.php"; @@ -215,8 +215,14 @@ if (PEAR::isError($err = $this->_assertStateDir())) { return $err; } + $open_mode = 'w'; // XXX People reported problems with LOCK_SH and 'w' - $open_mode = ($mode === LOCK_SH) ? 'r' : 'w'; + if ($mode === LOCK_SH) { + if (@!is_file($this->lockfile)) { + touch($this->lockfile); + } + $open_mode = 'r'; + } $this->lock_fp = @fopen($this->lockfile, $open_mode); if (!is_resource($this->lock_fp)) { return $this->raiseError("could not create lock file: $php_errormsg");

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