Definition at line 29 of file class.ilCurlConnection.php.
◆ __construct()
| ilCurlConnection::__construct |
( |
protected string |
$url = '', |
|
|
protected ?ilProxySettings |
$proxySettings = null |
|
) |
| |
◆ __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 117 of file class.ilCurlConnection.php.
References $res.
120 curl_setopt($this->ch, CURLOPT_HEADERFUNCTION, array($this,
'parseHeader'));
121 if ((
$res = curl_exec($this->ch)) ===
false) {
122 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 151 of file class.ilCurlConnection.php.
References $res.
Referenced by parseResponse().
154 $res = curl_getinfo($this->ch, $opt);
156 $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 167 of file class.ilCurlConnection.php.
169 $len = strlen($header);
170 $header = explode(
':', $header, 2);
171 if (count($header) === 2) {
172 $this->header_arr[strtolower(trim($header[0]))] = trim($header[1]);
◆ parseResponse()
| ilCurlConnection::parseResponse |
( |
string |
$a_response | ) |
|
Definition at line 131 of file class.ilCurlConnection.php.
References getInfo().
133 $header_size = $this->
getInfo(CURLINFO_HEADER_SIZE);
135 $this->header_plain = substr($a_response, 0, $header_size);
136 $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 105 of file class.ilCurlConnection.php.
Referenced by init().
107 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 |
The documentation for this class was generated from the following file: