PHP Class Kronolith_Driver_Ical, horde

Possible driver parameters: - url: The location of the remote calendar. - proxy: A hash with HTTP proxy information. - user: The user name for HTTP Basic Authentication. - password: The password for HTTP Basic Authentication.
Author: Chuck Hagenbuch ([email protected])
Author: Jan Schneider ([email protected])
Inheritance: extends Kronolith_Driver
Datei anzeigen Open project: horde/horde

Protected Properties

Property Type Description
$_cache array Cache events as we fetch them to avoid fetching or parsing the same event twice.
$_client Sabre\DAV\Client DAV client object.
$_davSupport array A list of DAV support levels.
$_permission integer The Horde_Perms permissions mask matching the CalDAV ACL.

Public Methods

Method Description
backgroundColor ( ) : string Returns the background color of the current calendar.
getEvent ( $eventId = null )
getPermission ( ) : integer Returns the permissions for the current calendar.
getRemoteCalendar ( boolean $cache = true ) : Horde_Icalendar Fetches a remote calendar into the cache and return the data.
isCalDAV ( ) : boolean Returns whether the remote calendar is a CalDAV server, and propagates the $_davSupport propery with the server's DAV capabilities.
listAlarms ( $date, $fullevent = false )
open ( string $calendar ) Selects a calendar as the currently opened calendar.

Protected Methods

Method Description
_addEvent ( Kronolith_Event $event ) : string Adds an event to the backend.
_convertEvents ( Horde_Icalendar $ical ) : array Converts all components of a Horde_Icalendar container into a Kronolith_Event list.
_deleteEvent ( string $eventId, boolean $silent = false ) Deletes an event.
_getClient ( string $uri ) : Sabre\DAV\Client Returns a configured, cached DAV client.
_getRemoteEvents ( ) : array Fetches a remote calendar and converts it to Kronolith_Event objects.
_getUrl ( ) : string Returns the URL of this calendar.
_listCalDAVEvents ( $startDate = null, $endDate = null, boolean $showRecurrence = false, boolean $hasAlarm = false, boolean $json = false, boolean $coverDates = true, $hideExceptions = false ) : array Lists all events in the time range, optionally restricting results to only events with alarms.
_listEvents ( Horde_Date $startDate = null, Horde_Date $endDate = null, array $options = [] ) Lists all events in the time range, optionally restricting results to only events with alarms.
_listWebDAVEvents ( $startDate = null, $endDate = null, boolean $showRecurrence = false, boolean $hasAlarm = false, boolean $json = false, boolean $coverDates = true, $hideExceptions = false ) : array Lists all events in the time range, optionally restricting results to only events with alarms.
_processComponents ( array &$results, array $events, $startDate, $endDate, boolean $showRecurrence, boolean $json, boolean $coverDates, boolean $hideExceptions, string $id = null ) Processes the components of a Horde_Icalendar container into an event list.
_request ( string $method, string $url, XMLWriter $xml = null, array $headers = [] ) : array Sends a CalDAV request.
_saveEvent ( Kronolith_Event $event ) : Sabre\HTTP\ResponseInterface Updates an existing event in the backend.
_updateEvent ( Kronolith_Event $event ) : string Updates an existing event in the backend.

Method Details

_addEvent() protected method

Adds an event to the backend.
protected _addEvent ( Kronolith_Event $event ) : string
$event Kronolith_Event The event to save.
return string The event id.

_convertEvents() protected method

Converts all components of a Horde_Icalendar container into a Kronolith_Event list.
protected _convertEvents ( Horde_Icalendar $ical ) : array
$ical Horde_Icalendar A Horde_Icalendar container.
return array List of Kronolith_Event_Ical objects.

_deleteEvent() protected method

Deletes an event.
protected _deleteEvent ( string $eventId, boolean $silent = false )
$eventId string The ID of the event to delete.
$silent boolean Don't send notifications, used when deleting events in bulk from maintenance tasks.

_getClient() protected method

Returns a configured, cached DAV client.
protected _getClient ( string $uri ) : Sabre\DAV\Client
$uri string The base URI for any requests.
return Sabre\DAV\Client A DAV client.

_getRemoteEvents() protected method

The converted event objects will be cached for an hour.
protected _getRemoteEvents ( ) : array
return array List of Kronolith_Event_Ical objects.

_getUrl() protected method

Does any necessary trimming and URL scheme fixes on the user-provided calendar URL.
protected _getUrl ( ) : string
return string The URL of this calendar.

_listCalDAVEvents() protected method

Lists all events in the time range, optionally restricting results to only events with alarms.
protected _listCalDAVEvents ( $startDate = null, $endDate = null, boolean $showRecurrence = false, boolean $hasAlarm = false, boolean $json = false, boolean $coverDates = true, $hideExceptions = false ) : array
$showRecurrence boolean Return every instance of a recurring event? If false, will only return recurring events once inside the $startDate - $endDate range.
$hasAlarm boolean Only return events with alarms?
$json boolean Store the results of the events' toJson() method?
$coverDates boolean Whether to add the events to all days that they cover. $param boolean $hideExceptions Hide events that represent exceptions to a recurring event.
return array Events in the given time range.

_listEvents() protected method

Lists all events in the time range, optionally restricting results to only events with alarms.
protected _listEvents ( Horde_Date $startDate = null, Horde_Date $endDate = null, array $options = [] )
$startDate Horde_Date The start of range date.
$endDate Horde_Date The end of date range.
$options array Additional options: - show_recurrence: (boolean) Return every instance of a recurring event? DEFAULT: false (Only return recurring events once inside $startDate - $endDate range) - has_alarm: (boolean) Only return events with alarms. DEFAULT: false (Return all events) - json: (boolean) Store the results of the event's toJson() method? DEFAULT: false - cover_dates: (boolean) Add the events to all days that they cover? DEFAULT: true - hide_exceptions: (boolean) Hide events that represent exceptions to a recurring event. DEFAULT: false (Do not hide exception events) - fetch_tags: (boolean) Fetch tags for all events. DEFAULT: false (Do not fetch event tags)

_listWebDAVEvents() protected method

Lists all events in the time range, optionally restricting results to only events with alarms.
protected _listWebDAVEvents ( $startDate = null, $endDate = null, boolean $showRecurrence = false, boolean $hasAlarm = false, boolean $json = false, boolean $coverDates = true, $hideExceptions = false ) : array
$showRecurrence boolean Return every instance of a recurring event? If false, will only return recurring events once inside the $startDate - $endDate range.
$hasAlarm boolean Only return events with alarms?
$json boolean Store the results of the events' toJson() method?
$coverDates boolean Whether to add the events to all days that they cover. $param boolean $hideExceptions Hide events that represent exceptions to a recurring event.
return array Events in the given time range.

_processComponents() protected method

Processes the components of a Horde_Icalendar container into an event list.
protected _processComponents ( array &$results, array $events, $startDate, $endDate, boolean $showRecurrence, boolean $json, boolean $coverDates, boolean $hideExceptions, string $id = null )
$results array Gets filled with the events in the given time range.
$events array A list of Kronolith_Event_Ical objects.
$showRecurrence boolean Return every instance of a recurring event? If false, will only return recurring events once inside the $startDate - $endDate range.
$json boolean Store the results of the events' toJson() method?
$coverDates boolean Whether to add the events to all days that they cover.
$hideExceptions boolean Hide events that represent exceptions to a recurring event.
$id string Enforce a certain event id (not UID).

_request() protected method

Sends a CalDAV request.
protected _request ( string $method, string $url, XMLWriter $xml = null, array $headers = [] ) : array
$method string A request method.
$url string A request URL.
$xml XMLWriter An XMLWriter object with the body content.
$headers array A hash with additional request headers.
return array The Horde_Http_Response object and the parsed SimpleXMLElement results.

_saveEvent() protected method

Updates an existing event in the backend.
protected _saveEvent ( Kronolith_Event $event ) : Sabre\HTTP\ResponseInterface
$event Kronolith_Event The event to save.
return Sabre\HTTP\ResponseInterface The HTTP response.

_updateEvent() protected method

Updates an existing event in the backend.
protected _updateEvent ( Kronolith_Event $event ) : string
$event Kronolith_Event The event to save.
return string The event id.

backgroundColor() public method

Returns the background color of the current calendar.
public backgroundColor ( ) : string
return string The calendar color.

getEvent() public method

public getEvent ( $eventId = null )

getPermission() public method

Returns the permissions for the current calendar.
public getPermission ( ) : integer
return integer A Horde_Perms permission bit mask.

getRemoteCalendar() public method

Fetches a remote calendar into the cache and return the data.
public getRemoteCalendar ( boolean $cache = true ) : Horde_Icalendar
$cache boolean Whether to return data from the cache.
return Horde_Icalendar The calendar data.

isCalDAV() public method

Returns whether the remote calendar is a CalDAV server, and propagates the $_davSupport propery with the server's DAV capabilities.
public isCalDAV ( ) : boolean
return boolean True if the remote calendar is a CalDAV server.

listAlarms() public method

public listAlarms ( $date, $fullevent = false )

open() public method

Selects a calendar as the currently opened calendar.
public open ( string $calendar )
$calendar string A calendar identifier.

Property Details

$_cache protected_oe property

Cache events as we fetch them to avoid fetching or parsing the same event twice.
protected array $_cache
return array

$_client protected_oe property

DAV client object.
protected Client,Sabre\DAV $_client
return Sabre\DAV\Client

$_davSupport protected_oe property

A list of DAV support levels.
protected array $_davSupport
return array

$_permission protected_oe property

The Horde_Perms permissions mask matching the CalDAV ACL.
protected int $_permission
return integer