當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。