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


PHP PEAR_ChannelFile::getMirrors方法代码示例

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


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

示例1: doInfo


//.........这里部分代码省略.........
         $channel = $chan->getName();
         $caption = 'Channel ' . $channel . ' Information:';
         $data1 = array('caption' => $caption, 'border' => true);
         $data1['data']['server'] = array('Name and Server', $chan->getName());
         if ($chan->getAlias() != $chan->getName()) {
             $data1['data']['alias'] = array('Alias', $chan->getAlias());
         }
         $data1['data']['summary'] = array('Summary', $chan->getSummary());
         $validate = $chan->getValidationPackage();
         $data1['data']['vpackage'] = array('Validation Package Name', $validate['_content']);
         $data1['data']['vpackageversion'] = array('Validation Package Version', $validate['attribs']['version']);
         $d = array();
         $d['main'] = $data1;
         $data['data'] = array();
         $data['caption'] = 'Server Capabilities';
         $data['headline'] = array('Type', 'Version/REST type', 'Function Name/REST base');
         $capabilities = $chan->getFunctions('xmlrpc');
         $soaps = $chan->getFunctions('soap');
         if ($capabilities || $soaps || $chan->supportsREST()) {
             if ($capabilities) {
                 if (!isset($capabilities[0])) {
                     $capabilities = array($capabilities);
                 }
                 foreach ($capabilities as $protocol) {
                     $data['data'][] = array('xmlrpc', $protocol['attribs']['version'], $protocol['_content']);
                 }
             }
             if ($soaps) {
                 if (!isset($soaps[0])) {
                     $soaps = array($soaps);
                 }
                 foreach ($soaps as $protocol) {
                     $data['data'][] = array('soap', $protocol['attribs']['version'], $protocol['_content']);
                 }
             }
             if ($chan->supportsREST()) {
                 $funcs = $chan->getFunctions('rest');
                 if (!isset($funcs[0])) {
                     $funcs = array($funcs);
                 }
                 foreach ($funcs as $protocol) {
                     $data['data'][] = array('rest', $protocol['attribs']['type'], $protocol['_content']);
                 }
             }
         } else {
             $data['data'][] = array('No supported protocols');
         }
         $d['protocols'] = $data;
         $data['data'] = array();
         $mirrors = $chan->getMirrors();
         if ($mirrors) {
             $data['caption'] = 'Channel ' . $channel . ' Mirrors:';
             unset($data['headline']);
             foreach ($mirrors as $mirror) {
                 $data['data'][] = array($mirror['attribs']['host']);
                 $d['mirrors'] = $data;
             }
             foreach ($mirrors as $i => $mirror) {
                 $data['data'] = array();
                 $data['caption'] = 'Mirror ' . $mirror['attribs']['host'] . ' Capabilities';
                 $data['headline'] = array('Type', 'Version/REST type', 'Function Name/REST base');
                 $capabilities = $chan->getFunctions('xmlrpc', $mirror['attribs']['host']);
                 $soaps = $chan->getFunctions('soap', $mirror['attribs']['host']);
                 if ($capabilities || $soaps || $chan->supportsREST($mirror['attribs']['host'])) {
                     if ($capabilities) {
                         if (!isset($capabilities[0])) {
                             $capabilities = array($capabilities);
                         }
                         foreach ($capabilities as $protocol) {
                             $data['data'][] = array('xmlrpc', $protocol['attribs']['version'], $protocol['_content']);
                         }
                     }
                     if ($soaps) {
                         if (!isset($soaps[0])) {
                             $soaps = array($soaps);
                         }
                         foreach ($soaps as $protocol) {
                             $data['data'][] = array('soap', $protocol['attribs']['version'], $protocol['_content']);
                         }
                     }
                     if ($chan->supportsREST($mirror['attribs']['host'])) {
                         $funcs = $chan->getFunctions('rest', $mirror['attribs']['host']);
                         if (!isset($funcs[0])) {
                             $funcs = array($funcs);
                         }
                         foreach ($funcs as $protocol) {
                             $data['data'][] = array('rest', $protocol['attribs']['type'], $protocol['_content']);
                         }
                     }
                 } else {
                     $data['data'][] = array('No supported protocols');
                 }
                 $d['mirrorprotocols' . $i] = $data;
             }
         }
         $this->ui->outputData($d, 'channel-info');
     } else {
         return $this->raiseError('Serious error: Channel "' . $params[0] . '" has a corrupted registry entry');
     }
 }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:101,代码来源:Channels.php


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