本文整理汇总了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 {