mirror of
https://github.com/Yubico/yubikey-val.git
synced 2024-12-01 15:24:16 +01:00
Refactor.
- rename $curlopts -> $opts.
This commit is contained in:
parent
5fc6c1c37d
commit
17378733af
@ -115,7 +115,7 @@ function sign($a, $apiKey, $logger)
|
|||||||
return $hmac;
|
return $hmac;
|
||||||
}
|
}
|
||||||
|
|
||||||
function curl_settings($logger, $ident, $ch, $url, $timeout, $curlopts)
|
function curl_settings($logger, $ident, $ch, $url, $timeout, $opts)
|
||||||
{
|
{
|
||||||
$logger->log(LOG_DEBUG, "$ident adding URL : $url");
|
$logger->log(LOG_DEBUG, "$ident adding URL : $url");
|
||||||
|
|
||||||
@ -125,13 +125,13 @@ function curl_settings($logger, $ident, $ch, $url, $timeout, $curlopts)
|
|||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
||||||
curl_setopt($ch, CURLOPT_FAILONERROR, TRUE);
|
curl_setopt($ch, CURLOPT_FAILONERROR, TRUE);
|
||||||
|
|
||||||
if (is_array($curlopts) === FALSE)
|
if (is_array($opts) === FALSE)
|
||||||
{
|
{
|
||||||
$logger->log(LOG_WARN, $ident . 'curl options must be an array');
|
$logger->log(LOG_WARN, $ident . 'curl options must be an array');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($curlopts as $key => $val)
|
foreach ($opts as $key => $val)
|
||||||
if (curl_setopt($ch, $key, $val) === FALSE)
|
if (curl_setopt($ch, $key, $val) === FALSE)
|
||||||
$logger->log(LOG_WARN, "$ident failed to set " . curl_opt_name($key));
|
$logger->log(LOG_WARN, "$ident failed to set " . curl_opt_name($key));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user