36 include_once(
'Services/WebServices/Curl/classes/class.ilCurlConnectionException.php');
60 if (!self::_isCurlExtensionLoaded()) {
74 if (!function_exists(
'curl_init')) {
107 if (strlen($this->url)) {
108 $this->ch = curl_init($this->url);
109 #$GLOBALS['ilLog']->write(__METHOD__ . ': ' . $this->url); 111 $this->ch = curl_init();
116 if (curl_errno($this->ch)) {
132 final public function setOpt($a_option, $a_value)
134 if (!@curl_setopt($this->ch, $a_option, $a_value)) {
150 curl_setopt($this->ch, CURLOPT_HEADERFUNCTION,
array($this,
'parseHeader'));
151 if ((@
$res = curl_exec($this->ch)) ===
false) {
152 if (strlen($err = curl_error($this->ch))) {
167 $header_size = $this->
getInfo(CURLINFO_HEADER_SIZE);
169 $this->header_plain = substr($a_response, 0, $header_size);
170 $this->response_body = substr($a_response, $header_size);
193 $res = curl_getinfo($this->ch, $opt);
195 $res = curl_getinfo($this->ch);
211 foreach ($lines as $line) {
212 list(
$name, $value) = explode(
':', $line, 2);
213 $this->header_arr[
$name] = $value;
226 if ($this->ch != null) {
227 curl_close($this->ch);
parseResponse($a_response)
parse response body
exec()
Wrapper for curl_exec.
init()
Init curl connection.
getResponseBody()
Get responce body.
parseHeader($handle, $header)
Parse respone header.
__construct($a_url='')
Constructor.
foreach($_POST as $key=> $value) $res
static _isCurlExtensionLoaded()
Check if curl extension is loaded.
getResponseHeader()
Get response header as string.
getResponseHeaderArray()
Get response header as array.
getInfo($opt=0)
Get informations about a specific transfer.
Create styles array
The data for the language used.
setOpt($a_option, $a_value)
Wrapper for curl_setopt.
__destruct()
Destructor public.