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

CalDAVClient::DoPUTRequest ( relative_url,
icalendar,
etag = null 
)

PUT a text/icalendar resource, returning the etag

Parameters:
string$relative_urlThe URL to make the request to, relative to $base_url
string$icalendarThe iCalendar resource to send to the server
string$etagThe etag of an existing resource to be overwritten, or '*' for a new resource.
Returns:
string The content of the response from the server

RSCDS will always return the real etag on PUT. Other CalDAV servers may need more work, but we are assuming we are running against RSCDS in this case.

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

References DoRequest(), SetContentType(), and SetMatch().

                                                                   {
    $this->body = $icalendar;

    curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, "PUT" );
    curl_setopt($this->curl, CURLOPT_HEADER, true);
    if ( $etag != null ) {
      $this->SetMatch( ($etag != '*'), $etag );
    }
    $this->SetContentType("text/icalendar");
    $headers = $this->DoRequest($relative_url);

    /**
    * RSCDS will always return the real etag on PUT.  Other CalDAV servers may need
    * more work, but we are assuming we are running against RSCDS in this case.
    */
    $etag = preg_replace( '/^.*Etag: "?([^"\r\n]+)"?\r?\n.*/is', '$1', $headers );
    return $etag;
  }

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index