Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/helpers/curl_helper.php
Show First 20 Lines • Show All 535 Lines • ▼ Show 20 Line(s) | |||||
$this->lastErrorMsg = curl_error($this->connectionID); | $this->lastErrorMsg = curl_error($this->connectionID); | ||||
} | } | ||||
$this->lastHTTPCode = $this->getInfo(CURLINFO_HTTP_CODE); | $this->lastHTTPCode = $this->getInfo(CURLINFO_HTTP_CODE); | ||||
if ( $close_connection ) { | if ( $close_connection ) { | ||||
$this->CloseConnection(); | $this->CloseConnection(); | ||||
} | } | ||||
$this->_resetSettings(); | |||||
} | } | ||||
/** | /** | ||||
* Closes connection to server | * Closes connection to server | ||||
* | * | ||||
* @access public | * @access public | ||||
*/ | */ | ||||
public function CloseConnection() | public function CloseConnection() | ||||
{ | { | ||||
curl_close($this->connectionID); | curl_close($this->connectionID); | ||||
if ( $this->debugMode ) { | if ( $this->debugMode ) { | ||||
$fields_hash = Array ( | $fields_hash = Array ( | ||||
'ResponseData' => $this->lastResponse, | 'ResponseData' => $this->lastResponse, | ||||
'ResponseDate' => adodb_mktime(), | 'ResponseDate' => adodb_mktime(), | ||||
'ResponseHttpCode' => $this->lastHTTPCode, | 'ResponseHttpCode' => $this->lastHTTPCode, | ||||
'CurlError' => $this->lastErrorCode != 0 ? '#' . $this->lastErrorCode . ' (' . $this->lastErrorMsg . ')' : '', | 'CurlError' => $this->lastErrorCode != 0 ? '#' . $this->lastErrorCode . ' (' . $this->lastErrorMsg . ')' : '', | ||||
); | ); | ||||
$this->Conn->doUpdate($fields_hash, TABLE_PREFIX . 'CurlLog', 'LogId = ' . $this->logId); | $this->Conn->doUpdate($fields_hash, TABLE_PREFIX . 'CurlLog', 'LogId = ' . $this->logId); | ||||
} | } | ||||
// restore debug mode setting | // restore debug mode setting | ||||
$this->debugMode = kUtil::constOn('DBG_CURL'); | $this->debugMode = kUtil::constOn('DBG_CURL'); | ||||
$this->_resetSettings(); | |||||
} | } | ||||
/** | /** | ||||
* Checks, that last curl request was successful | * Checks, that last curl request was successful | ||||
* | * | ||||
* @return bool | * @return bool | ||||
* @access public | * @access public | ||||
*/ | */ | ||||
Show All 9 Lines |