Definition at line 35 of file class.ilCurlConnection.php.
◆ __construct()
ilCurlConnection::__construct |
( |
string |
$a_url = '' | ) |
|
◆ __destruct()
ilCurlConnection::__destruct |
( |
| ) |
|
◆ _isCurlExtensionLoaded()
static ilCurlConnection::_isCurlExtensionLoaded |
( |
| ) |
|
|
staticfinal |
◆ close()
ilCurlConnection::close |
( |
| ) |
|
|
final |
◆ exec()
ilCurlConnection::exec |
( |
| ) |
|
|
final |
Wrapper for curl_exec.
- Returns
- bool|string
Definition at line 125 of file class.ilCurlConnection.php.
References $res.
128 curl_setopt($this->ch, CURLOPT_HEADERFUNCTION, array($this,
'parseHeader'));
129 if ((
$res = curl_exec($this->ch)) ===
false) {
130 if (($err = curl_error($this->ch)) !==
'') {
◆ getInfo()
ilCurlConnection::getInfo |
( |
|
$opt = 0 | ) |
|
Get information about a specific transfer.
- Parameters
-
int | option e.g CURLINFO_EFFECTIVE_URL |
- Returns
- mixed
Definition at line 159 of file class.ilCurlConnection.php.
References $res.
Referenced by parseResponse().
162 $res = curl_getinfo($this->ch, $opt);
164 $res = curl_getinfo($this->ch);
◆ getResponseBody()
ilCurlConnection::getResponseBody |
( |
| ) |
|
◆ getResponseHeader()
ilCurlConnection::getResponseHeader |
( |
| ) |
|
◆ getResponseHeaderArray()
ilCurlConnection::getResponseHeaderArray |
( |
| ) |
|
◆ init()
ilCurlConnection::init |
( |
bool |
$set_proxy = true | ) |
|
|
final |
◆ parseHeader()
ilCurlConnection::parseHeader |
( |
|
$handle, |
|
|
string |
$header |
|
) |
| |
|
private |
Parse respone header.
- Parameters
-
mixed | $handle | |
string | $header | |
- Returns
- int strlen of header
Definition at line 175 of file class.ilCurlConnection.php.
177 $len = strlen($header);
178 $header = explode(
':', $header, 2);
179 if (count($header) === 2) {
180 $this->header_arr[strtolower(trim($header[0]))] = trim($header[1]);
◆ parseResponse()
ilCurlConnection::parseResponse |
( |
string |
$a_response | ) |
|
Definition at line 139 of file class.ilCurlConnection.php.
References getInfo().
141 $header_size = $this->
getInfo(CURLINFO_HEADER_SIZE);
143 $this->header_plain = substr($a_response, 0, $header_size);
144 $this->response_body = substr($a_response, $header_size);
getInfo($opt=0)
Get information about a specific transfer.
◆ setOpt()
ilCurlConnection::setOpt |
( |
int |
$a_option, |
|
|
|
$a_value |
|
) |
| |
|
final |
Wrapper for curl_setopt.
- Parameters
-
int | $a_option | |
mixed | $a_value | |
- Returns
- bool
Definition at line 113 of file class.ilCurlConnection.php.
Referenced by init().
115 if (!curl_setopt($this->ch, $a_option, $a_value)) {
◆ $ch
ilCurlConnection::$ch = null |
|
protected |
◆ $header_arr
array ilCurlConnection::$header_arr = array() |
|
private |
◆ $header_plain
string ilCurlConnection::$header_plain = '' |
|
private |
◆ $response_body
string ilCurlConnection::$response_body = '' |
|
private |
◆ $url
string ilCurlConnection::$url = '' |
|
protected |
The documentation for this class was generated from the following file: