75        $buf = curl_exec($ch);
 
   76        if ( $buf === 
false ) {
 
   79                'CURL error #'.curl_errno($ch).
': '.curl_error($ch)
 
  107        $ch = curl_init($this->url);
 
  109        if (version_compare(PHP_VERSION, 
'5.1.3', 
'>=')) {
 
  111            curl_setopt_array($ch, $this->_curlOptions);
 
  113            foreach ($this->_curlOptions as 
$key => $value) {
 
  114                curl_setopt($ch, 
$key, $value);
 
  121        if ($this->caCertPath) {
 
  122            if ($this->validateCN) {
 
  123                curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
 
  125                curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
 
  127            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
 
  128            curl_setopt($ch, CURLOPT_CAINFO, $this->caCertPath);
 
  129            phpCAS::trace(
'CURL: Set CURLOPT_CAINFO ' . $this->caCertPath);
 
  131            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
 
  132            curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
 
  139        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 
  142        curl_setopt($ch, CURLOPT_HEADERFUNCTION, array($this, 
'_curlReadHeaders'));
 
  147        if (count($this->cookies)) {
 
  148            $cookieStrings = array();
 
  149            foreach ($this->cookies as 
$name => $val) {
 
  150                $cookieStrings[] = 
$name.
'='.$val;
 
  152            curl_setopt($ch, CURLOPT_COOKIE, implode(
';', $cookieStrings));
 
  158        if (count($this->headers)) {
 
  159            curl_setopt($ch, CURLOPT_HTTPHEADER, $this->headers);
 
  166            curl_setopt($ch, CURLOPT_POST, 1);
 
  167            curl_setopt($ch, CURLOPT_POSTFIELDS, $this->postBody);
 
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
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