// Some servers respond slow so we allow them to set a custom timeout if(!empty($globals['curl_timeout']) && $globals['curl_timeout'] > $time){ $time = (int) $globals['curl_timeout']; }
// Set the curl parameters. $ch = curl_init();
$HTTPHEADER = array();
// Do not load the content from cached URL // Some hosts have cache enabled and we do not want the content to be loaded from cache $HTTPHEADER[] = 'Cache-Control: no-cache';
// Turn off the server and peer verification (TrustManager Concept). curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
$no_follow_location = 0; if(function_exists('ini_get')){ $open_basedir = ini_get('open_basedir'); // Followlocation does not work if open_basedir is enabled if(!empty($open_basedir)){ $no_follow_location = 1; } }
//To check ES service with username and password if(!empty($username) && !empty($password)){ curl_setopt($ch, CURLOPT_USERPWD, "$username:$password"); }
// Get response from the server. $resp = curl_exec($ch);