cvs: php4 /pear/PEAR Registry.php

From: Date: Mon, 23 Jun 2003 05:23:20 +0000
Subject: cvs: php4 /pear/PEAR Registry.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-11135@lists.php.net to get a copy of this message
mj Mon Jun 23 01:23:20 2003 EDT Modified files: /php4/pear/PEAR Registry.php Log: * Re-Apply my patch for bug #23954 (including some style advices by Jon) # Somehow the patch got lost during James' CVS cleanup. Index: php4/pear/PEAR/Registry.php diff -u php4/pear/PEAR/Registry.php:1.43 php4/pear/PEAR/Registry.php:1.44 --- php4/pear/PEAR/Registry.php:1.43 Sun Jun 22 21:27:38 2003 +++ php4/pear/PEAR/Registry.php Mon Jun 23 01:23:20 2003 @@ -18,7 +18,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: Registry.php,v 1.43 2003/06/23 01:27:38 imajes Exp $ +// $Id: Registry.php,v 1.44 2003/06/23 05:23:20 mj Exp $ /* TODO: @@ -155,7 +155,24 @@ */ function _packageFileName($package) { - return "{$this->statedir}/{$package}.reg"; + if (is_file("{$this->statedir}/{$package}.reg")) { + return "{$this->statedir}/{$package}.reg"; + } + + /** + * Iterate through the directory to find the matching + * registry file, even if it has been provided in + * another case (foobar vs. FooBar) + */ + $package = strtolower($package); + if ($handle = opendir($this->statedir)) { + while (false !== ($file = readdir($handle))) { + if (strtolower($file) == "{$package}.reg") { + return "{$this->statedir}/{$file}"; + } + } + closedir($handle); + } } // }}}

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