public function GatherContentCurl::curl in GatherContent 7.2
Used to retrieve data from GatherContent and to download files.
1 call to GatherContentCurl::curl()
- GatherContentCurl::get in includes/
curl.inc - Call GatherContent API function.
File
- includes/
curl.inc, line 717 - Contains functions used to process and retrieve data from GatherContent.
Class
- GatherContentCurl
- @file Contains functions used to process and retrieve data from GatherContent.
Code
public function curl($url, $curl_opts = array()) {
@set_time_limit(60);
$session = curl_init();
curl_setopt($session, CURLOPT_URL, $url);
curl_setopt($session, CURLOPT_HEADER, FALSE);
curl_setopt($session, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($session, CURLOPT_SSL_VERIFYPEER, TRUE);
curl_setopt($session, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem');
curl_setopt_array($session, $curl_opts);
$response = curl_exec($session);
$httpcode = curl_getinfo($session, CURLINFO_HTTP_CODE);
curl_close($session);
return array(
'response' => $response,
'httpcode' => $httpcode,
);
}