You are here

function flickr_curl_set_defaults in Flickr 7

Set default cURL settings.

Parameters

array $options [reference]: Options array

object $ch [reference]: cURL Object

1 call to flickr_curl_set_defaults()
flickr_curl_http_request in ./flickr.inc
Performs an HTTP request over cURL. Taken from http://cgit.drupalcode.org/chr/tree/chr.module.

File

./flickr.inc, line 2035
The Flickr API functions.

Code

function flickr_curl_set_defaults(&$options, &$ch) {
  curl_setopt($ch, CURLOPT_HEADER, TRUE);
  curl_setopt($ch, CURLOPT_USERAGENT, $options['headers']['User-Agent']);
  curl_setopt($ch, CURLINFO_HEADER_OUT, TRUE);
  curl_setopt($ch, CURLOPT_TIMEOUT, $options['timeout']);
  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $options['timeout']);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $options['verify_ssl']);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $options['verify_ssl']);
  curl_setopt($ch, CURLOPT_MAXREDIRS, $options['max_redirects']);

  // Remove the user agent from the headers as it is already set.
  unset($options['headers']['User-Agent']);
}