cvs: php4 /pear/PEAR Registry.php
| From: | Martin Jansen | Date: | Sun, 22 Jun 2003 19:14:16 +0000 |
| Subject: | cvs: php4 /pear/PEAR Registry.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-11121@lists.php.net to get a copy of this message | ||
mj Sun Jun 22 15:14:16 2003 EDT
Modified files:
/php4/pear/PEAR Registry.php
Log:
* Fix for bug #23954
# MFH?
Index: php4/pear/PEAR/Registry.php
diff -u php4/pear/PEAR/Registry.php:1.41 php4/pear/PEAR/Registry.php:1.42
--- php4/pear/PEAR/Registry.php:1.41 Tue Jun 10 16:03:43 2003
+++ php4/pear/PEAR/Registry.php Sun Jun 22 15:14:16 2003
@@ -18,7 +18,7 @@
// | |
// +----------------------------------------------------------------------+
//
-// $Id: Registry.php,v 1.41 2003/06/10 20:03:43 imajes Exp $
+// $Id: Registry.php,v 1.42 2003/06/22 19:14:16 mj Exp $
/*
TODO:
@@ -155,7 +155,23 @@
*/
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);
+ }
}
// }}}