Logo Search packages:      
Sourcecode: davical version File versions  Download package

CalDAVClient::DoRequest ( relative_url = "" )

Send a request to the server

Parameters:
string$relative_urlThe URL to make the request to, relative to $base_url
Returns:
string The content of the response from the server

So we don't get annoyed at self-signed certificates. Should be a setup configuration thing really.

Call our magic write the data function. You'd think there would be a simple setopt call where we could set the data to be written, but no, we have to pass a function, which passes the data.

Definition at line 151 of file caldav-client.php.

Referenced by DoDELETERequest(), DoGETRequest(), DoOptionsRequest(), DoPUTRequest(), and DoXMLRequest().

                                           {

    curl_setopt($this->curl, CURLOPT_URL, $this->base_url . $relative_url );
    curl_setopt($this->curl, CURLOPT_USERAGENT, $this->user_agent );
    curl_setopt($this->curl, CURLOPT_HTTPHEADER, $this->headers );

    /**
    * So we don't get annoyed at self-signed certificates.  Should be a setup
    * configuration thing really.
    */
    curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, false );

    $bodylen = strlen($this->body);
    if ( $bodylen > 0 ) {
      /**
      * Call our magic write the data function.  You'd think there would be a
      * simple setopt call where we could set the data to be written, but no,
      * we have to pass a function, which passes the data.
      */
      curl_setopt($this->curl, CURLOPT_UPLOAD, true );
      __curl_init_callback($this->body);
      curl_setopt($this->curl, CURLOPT_INFILESIZE, $bodylen );
      curl_setopt($this->curl, CURLOPT_READFUNCTION, '__curl_read_callback' );
    }

    $this->response = curl_exec($this->curl);
    $this->resultcode = curl_getinfo( $this->curl, CURLINFO_HTTP_CODE);

    $this->headers[] = array();  // reset the headers array for our next request

    return $this->response;
  }

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index