36 include_once(
'Services/WebServices/Curl/classes/class.ilCurlConnectionException.php');
60 if(!self::_isCurlExtensionLoaded())
75 if(!function_exists(
'curl_init'))
109 if(strlen($this->url))
111 $this->ch = curl_init($this->url);
112 #$GLOBALS['ilLog']->write(__METHOD__ . ': ' . $this->url); 116 $this->ch = curl_init();
122 if(curl_errno($this->ch))
139 public final function setOpt($a_option, $a_value)
141 if(!@curl_setopt($this->ch, $a_option, $a_value))
158 curl_setopt($this->ch, CURLOPT_HEADERFUNCTION,
array($this,
'parseHeader'));
159 if((@
$res = curl_exec($this->ch)) ===
false)
161 if(strlen($err = curl_error($this->ch)))
179 $header_size = $this->
getInfo(CURLINFO_HEADER_SIZE);
181 $this->header_plain = substr($a_response, 0, $header_size);
182 $this->response_body = substr($a_response, $header_size);
206 $res = curl_getinfo($this->ch, $opt);
210 $res = curl_getinfo($this->ch);
226 foreach($lines as $line)
228 list($name,$value) = explode(
':',$line,2);
229 $this->header_arr[$name] = $value;
242 if($this->ch != null)
244 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.
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.