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


PHP Misc::streamSslContextOptions方法代码示例

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


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

示例1: _initiateStream

 /**
  * Initiate stream socket to IRC server.
  *
  * @access protected
  */
 protected function _initiateStream()
 {
     $this->_closeStream();
     $socket = stream_socket_client($this->_remote_socket_string, $error_number, $error_string, $this->_remote_connection_timeout, STREAM_CLIENT_CONNECT, stream_context_create(Misc::streamSslContextOptions(true)));
     if ($socket === false) {
         echo 'ERROR: ' . $error_string . ' (' . $error_number . ')' . PHP_EOL;
     } else {
         $this->_socket = $socket;
     }
 }
开发者ID:kaibosh,项目名称:nZEDb,代码行数:15,代码来源:IRCClient.php

示例2: fetchShowQuickInfo

 public function fetchShowQuickInfo($show, array $options = [])
 {
     $defaults = ['exact' => '', 'episode' => ''];
     $options += $defaults;
     $ret = [];
     if (!$show) {
         return false;
     }
     $url = $this->showQuickInfoURL . urlencode($show);
     $url .= !empty($options['episode']) ? '&ep=' . urlencode($options['episode']) : '';
     $url .= !empty($options['exact']) ? '&exact=' . urlencode($options['exact']) : '';
     $fp = fopen($url, "r", false, stream_context_create(Misc::streamSslContextOptions()));
     if ($fp) {
         while (!feof($fp)) {
             $line = fgets($fp, 1024);
             list($sec, $val) = explode('@', $line, 2);
             $val = trim($val);
             switch ($sec) {
                 case 'Show ID':
                     $ret['rageid'] = $val;
                     break;
                 case 'Show Name':
                     $ret['name'] = $val;
                     break;
                 case 'Show URL':
                     $ret['url'] = $val;
                     break;
                 case 'Premiered':
                     $ret['premier'] = $val;
                     break;
                 case 'Country':
                     $ret['country'] = $val;
                     break;
                 case 'Status':
                     $ret['status'] = $val;
                     break;
                 case 'Classification':
                     $ret['classification'] = $val;
                     break;
                 case 'Genres':
                     $ret['genres'] = $val;
                     break;
                 case 'Network':
                     $ret['network'] = $val;
                     break;
                 case 'Airtime':
                     $ret['airtime'] = $val;
                     break;
                 case 'Latest Episode':
                     list($ep, $title, $airdate) = explode('^', $val);
                     $ret['episode']['latest'] = $ep . ", \"" . $title . "\" aired on " . $airdate;
                     break;
                 case 'Next Episode':
                     list($ep, $title, $airdate) = explode('^', $val);
                     $ret['episode']['next'] = $ep . ", \"" . $title . "\" airs on " . $airdate;
                     break;
                 case 'Episode Info':
                     list($ep, $title, $airdate) = explode('^', $val);
                     $ret['episode']['info'] = $ep . ", \"" . $title . "\" aired on " . $airdate;
                     break;
                 case 'Episode URL':
                     $ret['episode']['url'] = $val;
                     break;
                 case '':
                     break;
                 default:
                     break;
             }
         }
         fclose($fp);
         return $ret;
     }
     return false;
 }
开发者ID:advhamstrong,项目名称:nZEDb,代码行数:74,代码来源:TvRage.php


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