cvs: php4(PHP_4_3) /pear/PEAR Registry.php

From: Date: Mon, 23 Jun 2003 06:44:19 +0000
Subject: cvs: php4(PHP_4_3) /pear/PEAR Registry.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-11137@lists.php.net to get a copy of this message
mj Mon Jun 23 02:44:19 2003 EDT Modified files: (Branch: PHP_4_3) /php4/pear/PEAR Registry.php Log: * MFH Index: php4/pear/PEAR/Registry.php diff -u php4/pear/PEAR/Registry.php:1.35.2.6 php4/pear/PEAR/Registry.php:1.35.2.7 --- php4/pear/PEAR/Registry.php:1.35.2.6 Tue Jun 17 13:13:18 2003 +++ php4/pear/PEAR/Registry.php Mon Jun 23 02:44:19 2003 @@ -18,7 +18,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: Registry.php,v 1.35.2.6 2003/06/17 17:13:18 pajoye Exp $ +// $Id: Registry.php,v 1.35.2.7 2003/06/23 06:44:19 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 (#11137) next »