1
0
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:
Jean Paul Galea 2015-07-22 19:48:43 +00:00
parent 5fc6c1c37d
commit 17378733af

View File

@ -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));
} }