ICal
class ICal (View source)
Class to read/parse ICal calendars
Properties
| string | $file | ||
| string | $file_text | ||
| array<string, array<"VEVENT"|"VFREEBUSY"|"VTODO", array<int, array<string, string>>>>|array<string, array<int, array<string, array<string, int>>>>|array<string, array<int, array<string, int>>>|array<string, array<int, array<string, string>>> | $cal | ||
| int | $event_count | ||
| int | $todo_count | ||
| int | $freebusy_count | ||
| string | $last_key | ||
| string | $error |
Methods
Constructor
Read text file, icalender text file
Returns the number of calendar events
Returns the number of to do
Translate Calendar
Add to $this->ical array one value and key.
Parse text "XXXX:value text some with : " and return array($key = "XXXX", $value="value");
Parse RRULE return array
Return Unix time from ical date time format (YYYYMMDD[T]HHMMSS[Z] or YYYYMMDD[T]HHMMSS)
Return unix date from iCal date format
Return sorted eventlist as array or false if calendar is empty
Compare two unix timestamp
Return eventlist array (not sorted eventlist array)
Return freebusy array (not sort eventlist array)
Return to do array (not sorted todo array)
Return base calendar data
Return array with all data
Details
__construct()
Constructor
string|null
read_file($file)
Read text file, icalender text file
@param string $file File
int
get_event_count()
Returns the number of calendar events
int
get_todo_count()
Returns the number of to do
string|array<string, array<"VEVENT"|"VFREEBUSY"|"VTODO", array<int, array<string, string>>>>|array<string, array<int, array<string, array<string, int>>>>|array<string, array<int, array<string, int>>>|array<string, array<int, array<string, string>>>
parse(string $uri, string $usecachefile = '', int $delaycache = 3600)
Translate Calendar
void
add_to_array(string $type, string $key, string $value)
Add to $this->ical array one value and key.
array{0: string, 1: string}
retun_key_value(string $text)
Parse text "XXXX:value text some with : " and return array($key = "XXXX", $value="value");
array<string, string>
ical_rrule(string $value)
Parse RRULE return array
int
ical_date_to_unix(string $ical_date)
Return Unix time from ical date time format (YYYYMMDD[T]HHMMSS[Z] or YYYYMMDD[T]HHMMSS)
array{0: string, 1: int}|array{0: string, 1: array<string, int|string>}
ical_dt_date(string $key, string $value)
Return unix date from iCal date format
array<int, array<string, string>>|false
get_sort_event_list()
Return sorted eventlist as array or false if calendar is empty
int
ical_dtstart_compare(array{DTSTART: array{unixtime: string}} $a, array{DTSTART: array{unixtime: string}} $b)
Compare two unix timestamp
array<int, array<string, string>>
get_event_list()
Return eventlist array (not sorted eventlist array)
array<int, array<string, string>>
get_freebusy_list()
Return freebusy array (not sort eventlist array)
array<int, array<string, string>>
get_todo_list()
Return to do array (not sorted todo array)
array<int, array<string, string>>
get_calender_data()
Return base calendar data
array<string, array<"VEVENT"|"VFREEBUSY"|"VTODO", array<int, array<string, string>>>>|array<string, array<int, array<string, array<string, int>>>>|array<string, array<int, array<string, int>>>|array<string, array<int, array<string, string>>>
get_all_data()
Return array with all data