summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Jansen <mj@php.net>2003-06-22 19:14:16 +0000
committerMartin Jansen <mj@php.net>2003-06-22 19:14:16 +0000
commitf2f140bbe9293fda66519844f83d47b3f8efbe92 (patch)
tree294004101791b5000a9d23e34ade9fe03962ba89
parenta594c7b71411bac2bf4da7d666b52d3b54f10779 (diff)
downloadphp-git-f2f140bbe9293fda66519844f83d47b3f8efbe92.tar.gz
* Fix for bug #23954
# MFH?
-rw-r--r--pear/PEAR/Registry.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/pear/PEAR/Registry.php b/pear/PEAR/Registry.php
index 252b0e7f58..482e0f369e 100644
--- a/pear/PEAR/Registry.php
+++ b/pear/PEAR/Registry.php
@@ -155,7 +155,23 @@ class PEAR_Registry extends PEAR
*/
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);
+ }
}
// }}}