DAViCal
|
Public Member Functions | |
__construct ( $base_url, $user, $pass) | |
SetDebug ( $new_value) | |
SetMatch ( $match, $etag=' *') | |
SetDepth ( $depth='0') | |
SetUserAgent ( $user_agent=null) | |
SetContentType ( $type) | |
SetCalendar ( $url) | |
ParseResponse ( $response) | |
ParseResponseHeaders () | |
GetHttpRequest () | |
GetResponseHeaders () | |
GetResponseBody () | |
GetXmlRequest () | |
GetXmlResponse () | |
DoRequest ( $url=null) | |
Unchunk () | |
DoOptionsRequest ( $url=null) | |
DoXMLRequest ( $request_method, $xml, $url=null) | |
DoGETRequest ( $url) | |
DoHEADRequest ( $url) | |
DoPUTRequest ( $url, $icalendar, $etag=null) | |
DoDELETERequest ( $url, $etag=null) | |
DoPROPFINDRequest ( $url, $props, $depth=0) | |
PrincipalURL ( $url=null) | |
CalendarHomeSet ( $urls=null) | |
CalendarUrls ( $urls=null) | |
HrefValueInside ( $tagname) | |
HrefForProp ( $tagname, $i=0) | |
HrefForResourcetype ( $tagname, $i=0) | |
GetOKProps ( $nodenum) | |
FindPrincipal ( $url=null) | |
FindCalendarHome ( $recursed=false) | |
FindCalendars ( $recursed=false) | |
GetCalendarDetails ( $url=null) | |
GetCollectionETags ( $url=null) | |
CalendarMultiget ( $event_hrefs, $url=null) | |
DoCalendarQuery ( $filter, $url='') | |
GetEvents ( $start=null, $finish=null, $relative_url='') | |
GetTodos ( $start, $finish, $completed=false, $cancelled=false, $relative_url="") | |
GetEntryByUid ( $uid, $relative_url='', $component_type='VEVENT') | |
GetEntryByHref ( $href) | |
CalDAVClient ( $base_url, $user, $pass, $calendar='') | |
SetMatch ( $match, $etag=' *') | |
SetDepth ( $depth='0') | |
SetUserAgent ( $user_agent=null) | |
SetContentType ( $type) | |
ParseResponse ( $response) | |
GetHttpRequest () | |
GetHttpResponse () | |
GetXmlRequest () | |
GetXmlResponse () | |
DoRequest ( $relative_url="") | |
DoOptionsRequest ( $relative_url="") | |
DoXMLRequest ( $request_method, $xml, $relative_url='') | |
DoGETRequest ( $relative_url) | |
DoPUTRequest ( $relative_url, $icalendar, $etag=null) | |
DoDELETERequest ( $relative_url, $etag=null) | |
DoCalendarQuery ( $filter, $relative_url='') | |
GetEvents ( $start=null, $finish=null, $relative_url='') | |
GetTodos ( $start, $finish, $completed=false, $cancelled=false, $relative_url="") | |
GetEntryByUid ( $uid, $relative_url='') | |
GetEntryByHref ( $href, $relative_url='') | |
Public Attributes | |
$user | |
$pass | |
$entry | |
$protocol | |
$server | |
$port | |
$user_agent = 'DAViCalClient' | |
$calendar | |
$httpResponse = "" | |
Protected Attributes | |
$base_url | |
$principal_url | |
$calendar_url | |
$calendar_home_set | |
$calendar_urls | |
$headers = array() | |
$body = "" | |
$requestMethod = "GET" | |
$httpRequest = "" | |
$xmlRequest = "" | |
$xmlResponse = "" | |
$httpResponseCode = 0 | |
$httpResponseHeaders = "" | |
$httpParsedHeaders | |
$httpResponseBody = "" | |
$parser | |
Private Attributes | |
$debug = false | |
A class for accessing DAViCal via CalDAV, as a client
Definition at line 44 of file caldav-client-v2.php.
CalDAVClient::__construct | ( | $base_url, | |
$user, | |||
$pass | |||
) |
Constructor, initialises the class
string | $base_url | The URL for the calendar server |
string | $user | The name of the user logging in |
string | $pass | The password for that user |
Definition at line 101 of file caldav-client-v2.php.
CalDAVClient::CalDAVClient | ( | $base_url, | |
$user, | |||
$pass, | |||
$calendar = '' |
|||
) |
Constructor, initialises the class
string | $base_url | The URL for the calendar server |
string | $user | The name of the user logging in |
string | $pass | The password for that user |
string | $calendar | The name of the calendar (not currently used) |
Definition at line 51 of file caldav-client.php.
CalDAVClient::CalendarHomeSet | ( | $urls = null | ) |
Get/Set the calendar-home-set URL
$url | array of string The calendar-home-set URLs to set |
Definition at line 532 of file caldav-client-v2.php.
CalDAVClient::CalendarMultiget | ( | $event_hrefs, | |
$url = null |
|||
) |
Get a bunch of events for a calendar with a calendar-multiget report
Definition at line 800 of file caldav-client-v2.php.
CalDAVClient::CalendarUrls | ( | $urls = null | ) |
Get/Set the calendar-home-set URL
$urls | array of string The calendar URLs to set |
Definition at line 546 of file caldav-client-v2.php.
CalDAVClient::DoCalendarQuery | ( | $filter, | |
$relative_url = '' |
|||
) |
Given XML for a calendar query, return an array of the events (/todos) in the response. Each event in the array will have a 'href', 'etag' and '$response_type' part, where the 'href' is relative to the calendar and the '$response_type' contains the definition of the calendar data in iCalendar format.
string | $filter | XML fragment which is the <filter> element of a calendar-query |
string | $relative_url | The URL relative to the base_url specified when the calendar was opened. Default ''. |
Definition at line 310 of file caldav-client.php.
CalDAVClient::DoCalendarQuery | ( | $filter, | |
$url = '' |
|||
) |
Given XML for a calendar query, return an array of the events (/todos) in the response. Each event in the array will have a 'href', 'etag' and '$response_type' part, where the 'href' is relative to the calendar and the '$response_type' contains the definition of the calendar data in iCalendar format.
string | $filter | XML fragment which is the <filter> element of a calendar-query |
string | $url | The URL of the calendar, or empty/null to use the 'current' calendar_url |
Definition at line 853 of file caldav-client-v2.php.
CalDAVClient::DoDELETERequest | ( | $relative_url, | |
$etag = null |
|||
) |
DELETE a text/icalendar resource
string | $relative_url | The URL to make the request to, relative to $base_url |
string | $etag | The etag of an existing resource to be deleted, or '*' for any resource at that URL. |
Definition at line 285 of file caldav-client.php.
CalDAVClient::DoDELETERequest | ( | $url, | |
$etag = null |
|||
) |
DELETE a text/icalendar resource
string | $url | The URL to make the request to |
string | $etag | The etag of an existing resource to be deleted, or '*' for any resource at that URL. |
Definition at line 480 of file caldav-client-v2.php.
CalDAVClient::DoGETRequest | ( | $relative_url | ) |
Get a single item from the server.
string | $relative_url | The part of the URL after the calendar |
Definition at line 242 of file caldav-client.php.
CalDAVClient::DoGETRequest | ( | $url | ) |
Get a single item from the server.
string | $url | The URL to GET |
Definition at line 416 of file caldav-client-v2.php.
CalDAVClient::DoHEADRequest | ( | $url | ) |
Get the HEAD of a single item from the server.
string | $url | The URL to HEAD |
Definition at line 428 of file caldav-client-v2.php.
CalDAVClient::DoOptionsRequest | ( | $relative_url = "" | ) |
Send an OPTIONS request to the server
string | $relative_url | The URL to make the request to, relative to $base_url |
Definition at line 208 of file caldav-client.php.
CalDAVClient::DoOptionsRequest | ( | $url = null | ) |
Send an OPTIONS request to the server
string | $url | The URL to make the request to |
Definition at line 378 of file caldav-client-v2.php.
CalDAVClient::DoPROPFINDRequest | ( | $url, | |
$props, | |||
$depth = 0 |
|||
) |
Get a single item from the server.
string | $url | The URL to PROPFIND on |
Definition at line 497 of file caldav-client-v2.php.
CalDAVClient::DoPUTRequest | ( | $relative_url, | |
$icalendar, | |||
$etag = null |
|||
) |
PUT a text/icalendar resource, returning the etag
string | $relative_url | The URL to make the request to, relative to $base_url |
string | $icalendar | The iCalendar resource to send to the server |
string | $etag | The etag of an existing resource to be overwritten, or '*' for a new resource. |
DAViCal will always return the real etag on PUT. Other CalDAV servers may need more work, but we are assuming we are running against DAViCal in this case.
Definition at line 258 of file caldav-client.php.
CalDAVClient::DoPUTRequest | ( | $url, | |
$icalendar, | |||
$etag = null |
|||
) |
PUT a text/icalendar resource, returning the etag
string | $url | The URL to make the request to |
string | $icalendar | The iCalendar resource to send to the server |
string | $etag | The etag of an existing resource to be overwritten, or '*' for a new resource. |
Definition at line 444 of file caldav-client-v2.php.
CalDAVClient::DoRequest | ( | $relative_url = "" | ) |
Send a request to the server
string | $relative_url | The URL to make the request to, relative to $base_url |
Definition at line 171 of file caldav-client.php.
CalDAVClient::DoRequest | ( | $url = null | ) |
Send a request to the server
string | $url | The URL to make the request to |
Definition at line 289 of file caldav-client-v2.php.
CalDAVClient::DoXMLRequest | ( | $request_method, | |
$xml, | |||
$relative_url = '' |
|||
) |
Send an XML request to the server (e.g. PROPFIND, REPORT, MKCALENDAR)
string | $method | The method (PROPFIND, REPORT, etc) to use with the request |
string | $xml | The XML to send along with the request |
string | $relative_url | The URL to make the request to, relative to $base_url |
Definition at line 228 of file caldav-client.php.
CalDAVClient::DoXMLRequest | ( | $request_method, | |
$xml, | |||
$url = null |
|||
) |
Send an XML request to the server (e.g. PROPFIND, REPORT, MKCALENDAR)
string | $method | The method (PROPFIND, REPORT, etc) to use with the request |
string | $xml | The XML to send along with the request |
string | $url | The URL to make the request to |
Definition at line 402 of file caldav-client-v2.php.
CalDAVClient::FindCalendarHome | ( | $recursed = false | ) |
Attack the given URL in an attempt to find a principal URL
string | $url | The URL to find the calendar-home-set from |
Definition at line 679 of file caldav-client-v2.php.
CalDAVClient::FindCalendars | ( | $recursed = false | ) |
Find the calendars, from the calendar_home_set
Definition at line 708 of file caldav-client-v2.php.
CalDAVClient::FindPrincipal | ( | $url = null | ) |
Attack the given URL in an attempt to find a principal URL
string | $url | The URL to find the principal-URL from |
Definition at line 656 of file caldav-client-v2.php.
CalDAVClient::GetCalendarDetails | ( | $url = null | ) |
Find the calendars, from the calendar_home_set
Definition at line 752 of file caldav-client-v2.php.
CalDAVClient::GetCollectionETags | ( | $url = null | ) |
Get all etags for a calendar
Definition at line 780 of file caldav-client-v2.php.
CalDAVClient::GetEntryByHref | ( | $href, | |
$relative_url = '' |
|||
) |
Get the calendar entry by HREF
string | $href | The href from a call to GetEvents or GetTodos etc. |
string | $relative_url | The URL relative to the base_url specified when the calendar was opened. Default ''. |
Definition at line 471 of file caldav-client.php.
CalDAVClient::GetEntryByHref | ( | $href | ) |
Get the calendar entry by HREF
string | $href | The href from a call to GetEvents or GetTodos etc. |
Definition at line 1013 of file caldav-client-v2.php.
CalDAVClient::GetEntryByUid | ( | $uid, | |
$relative_url = '' |
|||
) |
Get the calendar entry by UID
uid | ||
string | $relative_url | The URL relative to the base_url specified when the calendar was opened. Default ''. |
Definition at line 443 of file caldav-client.php.
CalDAVClient::GetEntryByUid | ( | $uid, | |
$relative_url = '' , |
|||
$component_type = 'VEVENT' |
|||
) |
Get the calendar entry by UID
uid | ||
string | $relative_url | The URL relative to the base_url specified when the calendar was opened. Default ''. |
string | $component_type | The component type inside the VCALENDAR. Default 'VEVENT'. |
Definition at line 986 of file caldav-client-v2.php.
CalDAVClient::GetEvents | ( | $start = null , |
|
$finish = null , |
|||
$relative_url = '' |
|||
) |
Get the events in a range from $start to $finish. The dates should be in the format yyyymmddThhmmssZ and should be in GMT. The events are returned as an array of event arrays. Each event array will have a 'href', 'etag' and 'event' part, where the 'href' is relative to the calendar and the event contains the definition of the event in iCalendar format.
timestamp | $start | The start time for the period |
timestamp | $finish | The finish time for the period |
string | $relative_url | The URL relative to the base_url specified when the calendar was opened. Default ''. |
Definition at line 368 of file caldav-client.php.
CalDAVClient::GetEvents | ( | $start = null , |
|
$finish = null , |
|||
$relative_url = '' |
|||
) |
Get the events in a range from $start to $finish. The dates should be in the format yyyymmddThhmmssZ and should be in GMT. The events are returned as an array of event arrays. Each event array will have a 'href', 'etag' and 'event' part, where the 'href' is relative to the calendar and the event contains the definition of the event in iCalendar format.
timestamp | $start | The start time for the period |
timestamp | $finish | The finish time for the period |
string | $relative_url | The URL relative to the base_url specified when the calendar was opened. Default ''. |
Definition at line 910 of file caldav-client-v2.php.
CalDAVClient::GetHttpRequest | ( | ) |
CalDAVClient::GetHttpRequest | ( | ) |
Output http request headers
Definition at line 246 of file caldav-client-v2.php.
CalDAVClient::GetHttpResponse | ( | ) |
CalDAVClient::GetOKProps | ( | $nodenum | ) |
Return the <prop> ... </prop> of a propstat where the status is OK
string | $nodenum | The node number in the xmlnodes which is the href |
Definition at line 623 of file caldav-client-v2.php.
CalDAVClient::GetResponseBody | ( | ) |
CalDAVClient::GetResponseHeaders | ( | ) |
Output http response headers
Definition at line 254 of file caldav-client-v2.php.
CalDAVClient::GetTodos | ( | $start, | |
$finish, | |||
$completed = false , |
|||
$cancelled = false , |
|||
$relative_url = "" |
|||
) |
Get the todo's in a range from $start to $finish. The dates should be in the format yyyymmddThhmmssZ and should be in GMT. The events are returned as an array of event arrays. Each event array will have a 'href', 'etag' and 'event' part, where the 'href' is relative to the calendar and the event contains the definition of the event in iCalendar format.
timestamp | $start | The start time for the period |
timestamp | $finish | The finish time for the period |
boolean | $completed | Whether to include completed tasks |
boolean | $cancelled | Whether to include cancelled tasks |
string | $relative_url | The URL relative to the base_url specified when the calendar was opened. Default ''. |
Definition at line 404 of file caldav-client.php.
CalDAVClient::GetTodos | ( | $start, | |
$finish, | |||
$completed = false , |
|||
$cancelled = false , |
|||
$relative_url = "" |
|||
) |
Get the todo's in a range from $start to $finish. The dates should be in the format yyyymmddThhmmssZ and should be in GMT. The events are returned as an array of event arrays. Each event array will have a 'href', 'etag' and 'event' part, where the 'href' is relative to the calendar and the event contains the definition of the event in iCalendar format.
timestamp | $start | The start time for the period |
timestamp | $finish | The finish time for the period |
boolean | $completed | Whether to include completed tasks |
boolean | $cancelled | Whether to include cancelled tasks |
string | $relative_url | The URL relative to the base_url specified when the calendar was opened. Default ''. |
Definition at line 946 of file caldav-client-v2.php.
CalDAVClient::GetXmlRequest | ( | ) |
CalDAVClient::GetXmlRequest | ( | ) |
CalDAVClient::GetXmlResponse | ( | ) |
CalDAVClient::GetXmlResponse | ( | ) |
CalDAVClient::HrefForProp | ( | $tagname, | |
$i = 0 |
|||
) |
Return the href containing this property. Except only if it's inside a status != 200
string | $tagname | The tag name of the property to find the href for |
integer | $which | Which instance of the tag should we use |
Definition at line 577 of file caldav-client-v2.php.
CalDAVClient::HrefForResourcetype | ( | $tagname, | |
$i = 0 |
|||
) |
Return the href which has a resourcetype of the specified type
string | $tagname | The tag name of the resourcetype to find the href for |
integer | $which | Which instance of the tag should we use |
Definition at line 603 of file caldav-client-v2.php.
CalDAVClient::HrefValueInside | ( | $tagname | ) |
Return the first occurrence of an href inside the named tag.
string | $tagname | The tag name to find the href inside of |
Definition at line 560 of file caldav-client-v2.php.
CalDAVClient::ParseResponse | ( | $response | ) |
Split response into httpResponse and xmlResponse
string | Response from server |
Definition at line 120 of file caldav-client.php.
CalDAVClient::ParseResponse | ( | $response | ) |
Split response into httpResponse and xmlResponse
string | Response from server |
Definition at line 195 of file caldav-client-v2.php.
CalDAVClient::ParseResponseHeaders | ( | ) |
Split httpResponseHeaders into an array of headers
Definition at line 221 of file caldav-client-v2.php.
CalDAVClient::PrincipalURL | ( | $url = null | ) |
Get/Set the Principal URL
$url | string The Principal URL to set |
Definition at line 519 of file caldav-client-v2.php.
CalDAVClient::SetCalendar | ( | $url | ) |
Set the calendar_url we will be using for a while.
string | $url | The calendar_url |
Definition at line 186 of file caldav-client-v2.php.
CalDAVClient::SetContentType | ( | $type | ) |
Add a Content-type: header.
int | $type | The content type |
Definition at line 111 of file caldav-client.php.
CalDAVClient::SetContentType | ( | $type | ) |
Add a Content-type: header.
string | $type | The content type |
Definition at line 177 of file caldav-client-v2.php.
CalDAVClient::SetDebug | ( | $new_value | ) |
Call this to enable / disable debugging. It will return the prior value of the debugging flag.
boolean | $new_value | The new value for debugging. |
Definition at line 132 of file caldav-client-v2.php.
CalDAVClient::SetDepth | ( | $depth = '0' | ) |
Add a Depth: header. Valid values are 0, 1 or infinity
int | $depth | The depth, default to infinity |
Definition at line 158 of file caldav-client-v2.php.
CalDAVClient::SetMatch | ( | $match, | |
$etag = '*' |
|||
) |
Adds an If-Match or If-None-Match header
bool | $match | to Match or Not to Match, that is the question! |
string | $etag | The etag to match / not match against. |
Definition at line 83 of file caldav-client.php.
CalDAVClient::SetMatch | ( | $match, | |
$etag = '*' |
|||
) |
Adds an If-Match or If-None-Match header
bool | $match | to Match or Not to Match, that is the question! |
string | $etag | The etag to match / not match against. |
Definition at line 149 of file caldav-client-v2.php.
CalDAVClient::SetUserAgent | ( | $user_agent = null | ) |
Add a Depth: header. Valid values are 1 or infinity
int | $depth | The depth, default to infinity |
Definition at line 101 of file caldav-client.php.
CalDAVClient::SetUserAgent | ( | $user_agent = null | ) |
Add a Depth: header. Valid values are 1 or infinity
int | $depth | The depth, default to infinity |
Definition at line 167 of file caldav-client-v2.php.
CalDAVClient::Unchunk | ( | ) |
Unchunk a chunked response
Definition at line 343 of file caldav-client-v2.php.
|
protected |
The calendar-home-set we're using
Definition at line 65 of file caldav-client-v2.php.
|
protected |
The calendar-URL we're using
Definition at line 60 of file caldav-client-v2.php.
|
protected |
The calendar_urls we have discovered
Definition at line 70 of file caldav-client-v2.php.
|
protected |
The principal-URL we're using
Definition at line 55 of file caldav-client-v2.php.