private function CurlFactory::getDefaultConf in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php \GuzzleHttp\Handler\CurlFactory::getDefaultConf()
1 call to CurlFactory::getDefaultConf()
- CurlFactory::create in vendor/
guzzlehttp/ guzzle/ src/ Handler/ CurlFactory.php - Creates a cURL handle resource.
File
- vendor/
guzzlehttp/ guzzle/ src/ Handler/ CurlFactory.php, line 192
Class
- CurlFactory
- Creates curl resources from a request
Namespace
GuzzleHttp\HandlerCode
private function getDefaultConf(EasyHandle $easy) {
$conf = [
'_headers' => $easy->request
->getHeaders(),
CURLOPT_CUSTOMREQUEST => $easy->request
->getMethod(),
CURLOPT_URL => (string) $easy->request
->getUri(),
CURLOPT_RETURNTRANSFER => false,
CURLOPT_HEADER => false,
CURLOPT_CONNECTTIMEOUT => 150,
];
if (defined('CURLOPT_PROTOCOLS')) {
$conf[CURLOPT_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS;
}
$version = $easy->request
->getProtocolVersion();
if ($version == 1.1) {
$conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1;
}
elseif ($version == 2.0) {
$conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2_0;
}
else {
$conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0;
}
return $conf;
}