本文整理匯總了PHP中PEAR_Registry::updatePackage2方法的典型用法代碼示例。如果您正苦於以下問題:PHP PEAR_Registry::updatePackage2方法的具體用法?PHP PEAR_Registry::updatePackage2怎麽用?PHP PEAR_Registry::updatePackage2使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PEAR_Registry
的用法示例。
在下文中一共展示了PEAR_Registry::updatePackage2方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: install
//.........這裏部分代碼省略.........
if (isset($parentreg['filelist'][$file])) {
unset($parentreg['filelist'][$file]);
} else {
$pos = strpos($file, '/');
$basedir = substr($file, 0, $pos);
$file2 = substr($file, $pos + 1);
if (isset($parentreg['filelist'][$file2]['baseinstalldir']) && $parentreg['filelist'][$file2]['baseinstalldir'] === $basedir) {
unset($parentreg['filelist'][$file2]);
}
}
unset($test[$file]);
}
} else {
if (strtolower($param->getChannel()) != 'pear.php.net') {
continue;
}
if (strtolower($info) == strtolower($param->getPackage())) {
if (isset($parentreg['filelist'][$file])) {
unset($parentreg['filelist'][$file]);
} else {
$pos = strpos($file, '/');
$basedir = substr($file, 0, $pos);
$file2 = substr($file, $pos + 1);
if (isset($parentreg['filelist'][$file2]['baseinstalldir']) && $parentreg['filelist'][$file2]['baseinstalldir'] === $basedir) {
unset($parentreg['filelist'][$file2]);
}
}
unset($test[$file]);
}
}
}
$pfk = new PEAR_PackageFile($this->config);
$parentpkg =& $pfk->fromArray($parentreg);
$installregistry->updatePackage2($parentpkg);
}
if ($param->getChannel() == 'pecl.php.net' && isset($options['upgrade'])) {
$tmp = $test;
foreach ($tmp as $file => $info) {
if (is_string($info)) {
// pear.php.net packages are always stored as strings
if (strtolower($info) == strtolower($param->getPackage())) {
// upgrading existing package
unset($test[$file]);
}
}
}
}
if (count($test)) {
$msg = "{$channel}/{$pkgname}: conflicting files found:\n";
$longest = max(array_map("strlen", array_keys($test)));
$fmt = "%{$longest}s (%s)\n";
foreach ($test as $file => $info) {
if (!is_array($info)) {
$info = array('pear.php.net', $info);
}
$info = $info[0] . '/' . $info[1];
$msg .= sprintf($fmt, $file, $info);
}
if (!isset($options['ignore-errors'])) {
return $this->raiseError($msg);
}
if (!isset($options['soft'])) {
$this->log(0, "WARNING: {$msg}");
}
}
}