本文整理汇总了PHP中PEAR_Downloader_Package::mergeDependencies方法的典型用法代码示例。如果您正苦于以下问题:PHP PEAR_Downloader_Package::mergeDependencies方法的具体用法?PHP PEAR_Downloader_Package::mergeDependencies怎么用?PHP PEAR_Downloader_Package::mergeDependencies使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PEAR_Downloader_Package
的用法示例。
在下文中一共展示了PEAR_Downloader_Package::mergeDependencies方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
//.........这里部分代码省略.........
}
}
}
unset($channelschecked);
PEAR_Downloader_Package::removeDuplicates($params);
if (!count($params)) {
$a = array();
return $a;
}
if (!isset($this->_options['nodeps']) && !isset($this->_options['offline'])) {
$reverify = true;
while ($reverify) {
$reverify = false;
foreach ($params as $i => $param) {
//PHP Bug 40768 / PEAR Bug #10944
//Nested foreaches fail in PHP 5.2.1
key($params);
$ret = $params[$i]->detectDependencies($params);
if (PEAR::isError($ret)) {
$reverify = true;
$params[$i] = false;
PEAR_Downloader_Package::removeDuplicates($params);
if (!isset($this->_options['soft'])) {
$this->log(0, $ret->getMessage());
}
continue 2;
}
}
}
}
if (isset($this->_options['offline'])) {
$this->log(3, 'Skipping dependency download check, --offline specified');
}
if (!count($params)) {
$a = array();
return $a;
}
while (PEAR_Downloader_Package::mergeDependencies($params)) {
}
PEAR_Downloader_Package::removeDuplicates($params, true);
$errorparams = array();
if (PEAR_Downloader_Package::detectStupidDuplicates($params, $errorparams)) {
if (count($errorparams)) {
foreach ($errorparams as $param) {
$name = $this->_registry->parsedPackageNameToString($param->getParsedPackage());
$this->pushError('Duplicate package ' . $name . ' found', PEAR_INSTALLER_FAILED);
}
$a = array();
return $a;
}
}
PEAR_Downloader_Package::removeInstalled($params);
if (!count($params)) {
$this->pushError('No valid packages found', PEAR_INSTALLER_FAILED);
$a = array();
return $a;
}
PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
$err = $this->analyzeDependencies($params);
PEAR::popErrorHandling();
if (!count($params)) {
$this->pushError('No valid packages found', PEAR_INSTALLER_FAILED);
$a = array();
return $a;
}
$ret = array();
$newparams = array();
if (isset($this->_options['pretend'])) {
return $params;
}
$somefailed = false;
foreach ($params as $i => $package) {
PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
$pf =& $params[$i]->download();
PEAR::staticPopErrorHandling();
if (PEAR::isError($pf)) {
if (!isset($this->_options['soft'])) {
$this->log(1, $pf->getMessage());
$this->log(0, 'Error: cannot download "' . $this->_registry->parsedPackageNameToString($package->getParsedPackage(), true) . '"');
}
$somefailed = true;
continue;
}
$newparams[] =& $params[$i];
$ret[] = array('file' => $pf->getArchiveFile(), 'info' => &$pf, 'pkg' => $pf->getPackage());
}
if ($somefailed) {
// remove params that did not download successfully
PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
$err = $this->analyzeDependencies($newparams, true);
PEAR::popErrorHandling();
if (!count($newparams)) {
$this->pushError('Download failed', PEAR_INSTALLER_FAILED);
$a = array();
return $a;
}
}
$this->_downloadedPackages = $ret;
return $newparams;
}
示例2: array
//.........这里部分代码省略.........
}
$curchannel =& $this->_registry->getChannel($params[$i]->getChannel());
if (PEAR::isError($curchannel)) {
PEAR::staticPopErrorHandling();
return $this->raiseError($curchannel);
}
$a = $this->downloadHttp('http://' . $params[$i]->getChannel() . '/channel.xml', $this->ui, System::mktemp(array('-d')), null, $curchannel->lastModified());
PEAR::staticPopErrorHandling();
if (PEAR::isError($a) || !$a) {
continue;
}
$this->log(0, 'WARNING: channel "' . $params[$i]->getChannel() . '" has ' . 'updated its protocols, use "channel-update ' . $params[$i]->getChannel() . '" to update');
}
if ($params[$i] && !isset($this->_options['downloadonly'])) {
if (isset($this->_options['packagingroot'])) {
$checkdir = $this->_prependPath($this->config->get('php_dir', null, $params[$i]->getChannel()), $this->_options['packagingroot']);
} else {
$checkdir = $this->config->get('php_dir', null, $params[$i]->getChannel());
}
while ($checkdir && $checkdir != '/' && !file_exists($checkdir)) {
$checkdir = dirname($checkdir);
}
if ($checkdir == '.') {
$checkdir = '/';
}
if (!@is_writeable($checkdir)) {
return PEAR::raiseError('Cannot install, php_dir for channel "' . $params[$i]->getChannel() . '" is not writeable by the current user');
}
}
}
}
unset($channelschecked);
PEAR_Downloader_Package::removeDuplicates($params);
if (!count($params)) {
$a = array();
return $a;
}
if (!isset($this->_options['nodeps']) && !isset($this->_options['offline'])) {
$reverify = true;
while ($reverify) {
$reverify = false;
foreach ($params as $i => $param) {
$ret = $params[$i]->detectDependencies($params);
if (PEAR::isError($ret)) {
$reverify = true;
$params[$i] = false;
PEAR_Downloader_Package::removeDuplicates($params);
if (!isset($this->_options['soft'])) {
$this->log(0, $ret->getMessage());
}
continue 2;
}
}
}
}
if (isset($this->_options['offline'])) {
$this->log(3, 'Skipping dependency download check, --offline specified');
}
if (!count($params)) {
$a = array();
return $a;
}
while (PEAR_Downloader_Package::mergeDependencies($params)) {
}
PEAR_Downloader_Package::removeInstalled($params);
if (!count($params)) {
$this->pushError('No valid packages found', PEAR_INSTALLER_FAILED);
$a = array();
return $a;
}
PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
$err = $this->analyzeDependencies($params);
PEAR::popErrorHandling();
if (!count($params)) {
$this->pushError('No valid packages found', PEAR_INSTALLER_FAILED);
$a = array();
return $a;
}
$ret = array();
$newparams = array();
if (isset($this->_options['pretend'])) {
return $params;
}
foreach ($params as $i => $package) {
PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
$pf =& $params[$i]->download();
PEAR::staticPopErrorHandling();
if (PEAR::isError($pf)) {
if (!isset($this->_options['soft'])) {
$this->log(1, $pf->getMessage());
$this->log(0, 'Error: cannot download "' . $this->_registry->parsedPackageNameToString($package->getParsedPackage(), true) . '"');
}
continue;
}
$newparams[] =& $params[$i];
$ret[] = array('file' => $pf->getArchiveFile(), 'info' => &$pf, 'pkg' => $pf->getPackage());
}
$this->_downloadedPackages = $ret;
return $newparams;
}