Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
StreamHandler example
if
(
\
function_exists
(
'curl_multi_exec'
)
&& \
function_exists
(
'curl_exec'
)
)
{
$handler
= Proxy::
wrapSync
(
new
CurlMultiHandler
(
)
,
new
CurlHandler
(
)
)
;
}
elseif
(
\
function_exists
(
'curl_exec'
)
)
{
$handler
=
new
CurlHandler
(
)
;
}
elseif
(
\
function_exists
(
'curl_multi_exec'
)
)
{
$handler
=
new
CurlMultiHandler
(
)
;
}
}
if
(
\
ini_get
(
'allow_url_fopen'
)
)
{
$handler
=
$handler
? Proxy::
wrapStreaming
(
$handler
,
new
StreamHandler
(
)
)
:
new
StreamHandler
(
)
;
}
elseif
(
!
$handler
)
{
throw
new
\
RuntimeException
(
'GuzzleHttp requires cURL, the allow_url_fopen ini setting, or a custom HTTP handler.'
)
;
}
return
$handler
;
}
/** * Get the default User-Agent string to use with Guzzle. */