mirror of
https://github.com/php/php-src.git
synced 2024-12-01 05:43:38 +08:00
parent
a594c7b714
commit
f2f140bbe9
@ -155,8 +155,24 @@ class PEAR_Registry extends PEAR
|
||||
*/
|
||||
function _packageFileName($package)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ _openPackageFile()
|
||||
|
Loading…
Reference in New Issue
Block a user