setPhpCurlOpts() public method

Fall back method to set your own curl options not currenctly explicitly support
public setPhpCurlOpts ( array $curlOpts )
$curlOpts array An array specifying which options to set and their values. The keys must be valid curl_setopt() constants or their integer equivalents.
Beispiel #1
0
 /**
  * Set the timeout for curl attempts in seconds
  * @param int $timeout timeout in seconds, must be > 0
  * @param \Bart\Curl $curler curl object to set timeout on
  * @throws HttpApiClientException Invalid Timeout in the event that the timeout is non-numeric or non > 0
  */
 protected function setTimeout($timeout, $curler)
 {
     if (is_int($timeout) && $timeout > 0) {
         $curler->setPhpCurlOpts(array(CURLOPT_TIMEOUT => $timeout));
     } elseif ($timeout !== null) {
         throw new HttpApiClientException("Invalid timeout: '{$timeout}'");
     }
 }