Definition at line 29 of file class.ilCurlConnection.php.
◆ __construct()
ilCurlConnection::__construct |
( |
protected string |
$url = '' , |
|
|
protected ?ilProxySettings |
$proxySettings = null |
|
) |
| |
Definition at line 37 of file class.ilCurlConnection.php.
41 if (!self::_isCurlExtensionLoaded()) {
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ __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)) !==
'') {
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ 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 |
Definition at line 64 of file class.ilCurlConnection.php.
References ilProxySettings\_getInstance(), close(), and setOpt().
Referenced by ilECSConnector\prepareConnection().
68 if ($this->url !==
'') {
69 $this->ch = curl_init($this->url);
71 $this->ch = curl_init();
76 if (curl_errno($this->ch)) {
83 if ($proxy->isActive()) {
84 $this->
setOpt(CURLOPT_HTTPPROXYTUNNEL,
true);
86 if (!empty($proxy->getHost())) {
87 $this->
setOpt(CURLOPT_PROXY, $proxy->getHost());
91 if (!empty($proxy->getPort())) {
92 $this->
setOpt(CURLOPT_PROXYPORT, $proxy->getPort());
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setOpt(int $a_option, $a_value)
Wrapper for curl_setopt.
◆ 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)) {
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ $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: