當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CString::replaceCi方法代碼示例

本文整理匯總了PHP中CString::replaceCi方法的典型用法代碼示例。如果您正苦於以下問題:PHP CString::replaceCi方法的具體用法?PHP CString::replaceCi怎麽用?PHP CString::replaceCi使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CString的用法示例。


在下文中一共展示了CString::replaceCi方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setInternalOptions


//.........這裏部分代碼省略.........
                                     $options[CURLOPT_HEADER] = true;
                                     $options[CURLOPT_NOBODY] = true;
                                 }
                             }
                         }
                     }
                 }
             }
         }
         // HTTP redirections.
         $options[CURLOPT_FOLLOWLOCATION] = $this->m_redirection;
         if ($this->m_redirection) {
             if (isset($this->m_maxNumRedirections)) {
                 $options[CURLOPT_MAXREDIRS] = $this->m_maxNumRedirections;
             }
             if (isset($this->m_redirectionAutoReferer)) {
                 $options[CURLOPT_AUTOREFERER] = $this->m_redirectionAutoReferer;
             }
             if (isset($this->m_redirectionKeepAuth)) {
                 $options[CURLOPT_UNRESTRICTED_AUTH] = $this->m_redirectionKeepAuth;
             }
         }
         // HTTP response code treatment.
         $options[CURLOPT_FAILONERROR] = $this->m_failOn400ResponseCodeOrGreater;
         // HTTP headers.
         if ($this->m_sendDefaultAcceptEncodingHeader && !(isset($this->m_requestHeaders) && $this->hasHeader(CHttpRequest::ACCEPT_ENCODING))) {
             $options[CURLOPT_ENCODING] = "";
         }
         if ($this->m_sendDefaultUserAgentHeader && !(isset($this->m_requestHeaders) && $this->hasHeader(CHttpRequest::USER_AGENT))) {
             $userAgent = self::$ms_defaultUserAgent;
             $curlVersion = self::curlVersion();
             $sslVersion = self::openSslVersion();
             $sslVersion = CRegex::remove($sslVersion, "/OpenSSL(\\/|\\h+)/i");
             $userAgent = CString::replaceCi($userAgent, "curl/x.x.x", "curl/{$curlVersion}");
             $userAgent = CString::replaceCi($userAgent, "libcurl x.x.x", "libcurl {$curlVersion}");
             $userAgent = CString::replaceCi($userAgent, "OpenSSL x.x.x", "OpenSSL {$sslVersion}");
             $this->addHeader(CHttpRequest::USER_AGENT, $userAgent);
         }
         if (isset($this->m_requestHeaders) && !CArray::isEmpty($this->m_requestHeaders)) {
             $options[CURLOPT_HTTPHEADER] = CArray::toPArray($this->m_requestHeaders);
         }
         if (isset($this->m_requestCookies) && !CArray::isEmpty($this->m_requestCookies)) {
             // Custom HTTP cookies.
             $cookieHeaderValue = CArray::join($this->m_requestCookies, "; ");
             $options[CURLOPT_COOKIE] = $cookieHeaderValue;
         }
         if (isset($cookiesFp)) {
             $options[CURLOPT_COOKIEFILE] = $cookiesFp;
             $options[CURLOPT_COOKIEJAR] = $cookiesFp;
         }
         if (isset($newCookieSession) && $newCookieSession) {
             $options[CURLOPT_COOKIESESSION] = true;
         }
         // Needed for the retrieval of information regarding the data transfer after it is complete.
         $options[CURLINFO_HEADER_OUT] = true;
         // Needed for the retrieval of response headers.
         $options[CURLOPT_HEADERFUNCTION] = [$this, "headerFunction"];
         if (isset($this->m_userAndPassword)) {
             // HTTP authentication. Let cURL pick any authentication method it finds suitable (it will
             // automatically select the one it finds most secure).
             $options[CURLOPT_HTTPAUTH] = CURLAUTH_ANY;
         }
     } else {
         if ($this->m_type == self::FTP_LIST) {
             $options[CURLOPT_FTPLISTONLY] = true;
         } else {
開發者ID:nunodotferreira,項目名稱:Phred,代碼行數:67,代碼來源:CInetRequest.php


注:本文中的CString::replaceCi方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。