36 include_once(
'Services/WebServices/Curl/classes/class.ilCurlConnectionException.php');
60 if (!self::_isCurlExtensionLoaded()) {
74 if (!function_exists(
'curl_init')) {
109 if (strlen($this->url)) {
110 $this->ch = curl_init($this->url);
111 #$GLOBALS['DIC']['ilLog']->write(__METHOD__ . ': ' . $this->url); 113 $this->ch = curl_init();
118 if (curl_errno($this->ch)) {
134 final public function setOpt($a_option, $a_value)
136 if (!@curl_setopt($this->ch, $a_option, $a_value)) {
152 curl_setopt($this->ch, CURLOPT_HEADERFUNCTION, array($this,
'parseHeader'));
153 if ((@
$res = curl_exec($this->ch)) ===
false) {
154 if (strlen($err = curl_error($this->ch))) {
169 $header_size = $this->
getInfo(CURLINFO_HEADER_SIZE);
171 $this->header_plain = substr($a_response, 0, $header_size);
172 $this->response_body = substr($a_response, $header_size);
195 $res = curl_getinfo($this->ch, $opt);
197 $res = curl_getinfo($this->ch);
213 foreach ($lines as $line) {
214 list(
$name, $value) = explode(
':', $line, 2);
215 $this->header_arr[
$name] = $value;
228 if ($this->ch != null) {
229 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.
setOpt($a_option, $a_value)
Wrapper for curl_setopt.
__destruct()
Destructor public.