mirror of
https://github.com/php/php-src.git
synced 2024-11-28 12:26:37 +08:00
* PEAR_Registry::updatePackage now takes an optional 2nd arg for
replacing package info instead of merging
This commit is contained in:
parent
913578add9
commit
491a2f5219
@ -143,7 +143,7 @@ class PEAR_Registry
|
||||
// }}}
|
||||
// {{{ updatePackage()
|
||||
|
||||
function updatePackage($package, $info)
|
||||
function updatePackage($package, $info, $merge = true)
|
||||
{
|
||||
$oldinfo = $this->packageInfo($package);
|
||||
if (empty($oldinfo)) {
|
||||
@ -153,7 +153,11 @@ class PEAR_Registry
|
||||
if ($fp === null) {
|
||||
return false;
|
||||
}
|
||||
fwrite($fp, serialize(array_merge($oldinfo, $info)));
|
||||
if ($merge) {
|
||||
fwrite($fp, serialize(array_merge($oldinfo, $info)));
|
||||
} else {
|
||||
fwrite($fp, serialize($info));
|
||||
}
|
||||
$this->_closePackageFile($fp);
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user