function __construct($htmlentities = true)
{
// if the cURL extension is not available, trigger an error and stop execution
if (!extension_loaded('curl')) {
trigger_error('php_curl extension is not loaded', E_USER_ERROR);
}
// initialize some private properties
$this->_multi_handle = $this->_queue = false;
$this->_running = $this->_requests = array();
// the default number of seconds to wait between processing batches of requests
// 0 means no waiting, process all requests at once
$this->pause_interval = 0;
// the default number of parallel, asynchronous, requests to be processed by the library at all times
// (unless the "pause_interval" property is greater than 0, case in which it refers to the number of requests
// to be processed before pausing)
$this->threads = 10;
// set the user's preference on whether to run htmlentities() on the response body or not
$this->_htmlentities = $htmlentities;
// set defaults for libcurl
// set defaults
$this->option(array(CURLINFO_HEADER_OUT => 1, CURLOPT_AUTOREFERER => 1, CURLOPT_COOKIEFILE => '', CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_ENCODING => 'gzip,deflate', CURLOPT_FOLLOWLOCATION => 1, CURLOPT_HEADER => 1, CURLOPT_MAXREDIRS => 50, CURLOPT_TIMEOUT => 30, CURLOPT_USERAGENT => $this->_user_agent(), CURLOPT_RETURNTRANSFER => 1));
// if PHP version is at least 5.5
if (version_compare(PHP_VERSION, '5.5') >= 0) {
// disable usage of @ in POST arguments
// see https://wiki.php.net/rfc/curl-file-upload
$this->option(CURLOPT_SAFE_UPLOAD, true);
}
// set defaults for accessing HTTPS servers
$this->ssl();
// caching is disabled by default
$this->cache(false);
}