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


PHP PEAR_PackageFile::installBinary方法代码示例

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


在下文中一共展示了PEAR_PackageFile::installBinary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: doInstall


//.........这里部分代码省略.........
         foreach ($errors as $error) {
             $err['data'][] = array($error);
         }
         $err['headline'] = 'Install Errors';
         $this->ui->outputData($err);
         if (!count($downloaded)) {
             return $this->raiseError("{$command} failed");
         }
     }
     $data = array('headline' => 'Packages that would be Installed');
     if (isset($options['pretend'])) {
         foreach ($downloaded as $package) {
             $data['data'][] = array($reg->parsedPackageNameToString($package->getParsedPackage()));
         }
         $this->ui->outputData($data, 'pretend');
         return true;
     }
     $this->installer->setOptions($options);
     $this->installer->sortPackagesForInstall($downloaded);
     if (PEAR::isError($err = $this->installer->setDownloadedPackages($downloaded))) {
         $this->raiseError($err->getMessage());
         return true;
     }
     $extrainfo = array();
     $binaries = array();
     foreach ($downloaded as $param) {
         PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
         $info = $this->installer->install($param, $options);
         PEAR::staticPopErrorHandling();
         if (PEAR::isError($info)) {
             $oldinfo = $info;
             $pkg =& $param->getPackageFile();
             if ($info->getCode() != PEAR_INSTALLER_NOBINARY) {
                 if (!($info = $pkg->installBinary($this->installer))) {
                     $this->ui->outputData('ERROR: ' . $oldinfo->getMessage());
                     continue;
                 }
                 // we just installed a different package than requested,
                 // let's change the param and info so that the rest of this works
                 $param = $info[0];
                 $info = $info[1];
             }
         }
         if (is_array($info)) {
             if ($param->getPackageType() == 'extsrc' || $param->getPackageType() == 'extbin' || $param->getPackageType() == 'zendextsrc' || $param->getPackageType() == 'zendextbin') {
                 $pkg =& $param->getPackageFile();
                 if ($instbin = $pkg->getInstalledBinary()) {
                     $instpkg =& $instreg->getPackage($instbin, $pkg->getChannel());
                 } else {
                     $instpkg =& $instreg->getPackage($pkg->getPackage(), $pkg->getChannel());
                 }
                 foreach ($instpkg->getFilelist() as $name => $atts) {
                     $pinfo = pathinfo($atts['installed_as']);
                     if (!isset($pinfo['extension']) || in_array($pinfo['extension'], array('c', 'h'))) {
                         continue;
                         // make sure we don't match php_blah.h
                     }
                     if (strpos($pinfo['basename'], 'php_') === 0 && $pinfo['extension'] == 'dll' || $pinfo['extension'] == 'so' || $pinfo['extension'] == 'sl') {
                         $binaries[] = array($atts['installed_as'], $pinfo);
                         break;
                     }
                 }
                 if (count($binaries)) {
                     foreach ($binaries as $pinfo) {
                         PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
                         $ret = $this->enableExtension(array($pinfo[0]), $param->getPackageType());
开发者ID:Esleelkartea,项目名称:kz-adeada-talleres-electricos-,代码行数:67,代码来源:Install.php


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