public function _exec()
{
$this->response = curl_exec($this->curl);
$this->curl_error_code = curl_errno($this->curl);
$this->curl_error_message = curl_error($this->curl);
$this->curl_error = !($this->curl_error_code === 0);
$this->http_status_code = curl_getinfo($this->curl, CURLINFO_HTTP_CODE);
$this->http_error = in_array(floor($this->http_status_code / 100), array(4, 5));
$this->error = $this->curl_error || $this->http_error;
$this->error_code = $this->error ? $this->curl_error ? $this->curl_error_code : $this->http_status_code : 0;
$this->request_headers = preg_split('/\\r\\n/', curl_getinfo($this->curl, CURLINFO_HEADER_OUT), null, PREG_SPLIT_NO_EMPTY);
$this->response_headers = '';
if (!(strpos($this->response, "\r\n\r\n") === false)) {
list($response_header, $this->response) = explode("\r\n\r\n", $this->response, 2);
while (strtolower(trim($response_header)) === 'http/1.1 100 continue') {
list($response_header, $this->response) = explode("\r\n\r\n", $this->response, 2);
}
$this->response_headers = preg_split('/\\r\\n/', $response_header, null, PREG_SPLIT_NO_EMPTY);
}
$this->http_error_message = $this->error ? isset($this->response_headers['0']) ? $this->response_headers['0'] : '' : '';
$this->error_message = $this->curl_error ? $this->curl_error_message : $this->http_error_message;
return $this->error_code;
}