36 include_once(
'Services/WebServices/Curl/classes/class.ilCurlConnectionException.php');
58 if(!self::_isCurlExtensionLoaded())
73 if(!function_exists(
'curl_init'))
107 if(strlen($this->url))
109 $this->ch = curl_init($this->url);
110 $GLOBALS[
'ilLog']->write(__METHOD__ .
': ' . $this->url);
114 $this->ch = curl_init();
120 if(curl_errno($this->ch))
137 public final function setOpt($a_option, $a_value)
139 if(!@curl_setopt($this->ch, $a_option, $a_value))
156 curl_setopt($this->ch, CURLOPT_HEADERFUNCTION, array($this,
'parseHeader'));
157 if((@
$res = curl_exec($this->ch)) ===
false)
159 if(strlen($err = curl_error($this->ch)))
183 $res = curl_getinfo($this->ch, $opt);
187 $res = curl_getinfo($this->ch);
200 $this->header_plain = $header;
203 foreach($lines as $line)
205 list($name,$value) = explode(
':',$line,2);
206 $this->header_arr[$name] = $value;
219 if($this->ch != null)
221 curl_close($this->ch);