73        $buf = curl_exec($ch);
 
   77                'CURL error #' . curl_errno($ch) . 
': ' . curl_error($ch)
 
  104        $ch = curl_init($this->url);
 
  106        if (version_compare(PHP_VERSION, 
'5.1.3', 
'>=')) {
 
  108            curl_setopt_array($ch, $this->_curlOptions);
 
  110            foreach ($this->_curlOptions as 
$key => $value) {
 
  111                curl_setopt($ch, 
$key, $value);
 
  118        if ($this->caCertPath) {
 
  119            if ($this->validateCN) {
 
  120                curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
 
  122                curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
 
  124            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
 
  125            curl_setopt($ch, CURLOPT_CAINFO, $this->caCertPath);
 
  126            phpCAS::trace(
'CURL: Set CURLOPT_CAINFO ' . $this->caCertPath);
 
  128            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
 
  129            curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
 
  136        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 
  139        curl_setopt($ch, CURLOPT_HEADERFUNCTION, array($this, 
'_curlReadHeaders'));
 
  144        if (count($this->cookies)) {
 
  145            $cookieStrings = array();
 
  146            foreach ($this->cookies as 
$name => $val) {
 
  147                $cookieStrings[] = 
$name . 
'=' . $val;
 
  149            curl_setopt($ch, CURLOPT_COOKIE, implode(
';', $cookieStrings));
 
  155        if (count($this->headers)) {
 
  156            curl_setopt($ch, CURLOPT_HTTPHEADER, $this->headers);
 
  163            curl_setopt($ch, CURLOPT_POST, 1);
 
  164            curl_setopt($ch, CURLOPT_POSTFIELDS, $this->postBody);
 
An exception for terminatinating execution or to throw for unit testing.
Provides support for performing web-requests via curl.
storeErrorMessage($message)
Add a string to our error message.
storeResponseBody($body)
Store the response body.
storeResponseHeader($header)
Store a single response header to our array.
Provides support for performing web-requests via curl.
_storeResponseBody($body)
Store the response body.
initAndConfigure()
Internal method to initialize our cURL handle and configure the request.
setCurlOptions(array $options)
Set additional curl options.
sendRequest()
Send the request and store the results.
_curlReadHeaders($ch, $header)
Internal method for capturing the headers from a curl request.
static trace($str)
This method is used to log something in debug mode.
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode.
This interface defines a class library for performing web requests.
foreach($_POST as $key=> $value) $res