当前位置: 首页>>代码示例>>PHP>>正文


PHP PEAR_Downloader_Package::detectStupidDuplicates方法代码示例

本文整理汇总了PHP中PEAR_Downloader_Package::detectStupidDuplicates方法的典型用法代码示例。如果您正苦于以下问题:PHP PEAR_Downloader_Package::detectStupidDuplicates方法的具体用法?PHP PEAR_Downloader_Package::detectStupidDuplicates怎么用?PHP PEAR_Downloader_Package::detectStupidDuplicates使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PEAR_Downloader_Package的用法示例。


在下文中一共展示了PEAR_Downloader_Package::detectStupidDuplicates方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
 }
开发者ID:shen0834,项目名称:util,代码行数:101,代码来源:Downloader.php


注:本文中的PEAR_Downloader_Package::detectStupidDuplicates方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。