Properties

$geoLatFmt

$geoLatFmt : string

Type

string — output format for geo latitude and longitude (before rtrim)

$geoLongFmt

$geoLongFmt : 

Type

$fmt

$fmt : array

Type

array — date/datetime formats

$vComps

$vComps : array

Type

array — component property UID value

$mComps

$mComps : 

Type

$miscComps

$miscComps : 

Type

$tzComps

$tzComps : 

Type

$allComps

$allComps : 

Type

$mProps1

$mProps1 : array

Type

array — component property collections

$mProps2

$mProps2 : 

Type

$dateProps

$dateProps : 

Type

$otherProps

$otherProps : 

Type

$baseDelim

$baseDelim : string

Type

string — tmp line delimiter, used in convEolChar (parse)

$parValPrefix

$parValPrefix : array

Type

array — protocol prefix, used in _splitContent()

$m_pInstance

$m_pInstance : object

Type

object — Store the single instance of iCalUtilityFunctions

Methods

getInstance()

getInstance() 

Getter method for creating/returning the single instance of this class

_chkDateArr()

_chkDateArr(array  $datetime, integer  $parno = FALSE) : array

ensures internal date-time/date format (keyed array) for an input date-time/date array (keyed or unkeyed)

Parameters

array $datetime
integer $parno

optional, default FALSE

Returns

array

_chkdatecfg()

_chkdatecfg(array  $theDate, integer  $parno, array  $params) : void

check date(-time) and params arrays for an opt. timezone and if it is a DATE-TIME or DATE (updates $parno and params)

Parameters

array $theDate

date to check

integer $parno

no of date parts (i.e. year, month.. .)

array $params

property parameters

_cmpfcn()

_cmpfcn(array  $a, array  $b) : integer

vcalendar sort callback function

Parameters

array $a
array $b

Returns

integer

convEolChar()

convEolChar(string  $text, string  $nl) : string

byte oriented line folding fix

remove any line-endings that may include spaces or tabs and convert all line endings (iCal default '\r\n'), takes care of '\r\n', '\r' and '\n' and mixed '\r\n'+'\r', '\r\n'+'\n'

Parameters

string $text
string $nl

Returns

string

createTimezone()

createTimezone(object  $calendar, string  $timezone, array  $xProp = array(), integer  $from = null, integer  $to = null) : boolean

create a calendar timezone and standard/daylight components

Result when 'Europe/Stockholm' and no from/to arguments is used as timezone:

BEGIN:VTIMEZONE TZID:Europe/Stockholm BEGIN:STANDARD DTSTART:20101031T020000 TZOFFSETFROM:+0200 TZOFFSETTO:+0100 TZNAME:CET END:STANDARD BEGIN:DAYLIGHT DTSTART:20100328T030000 TZOFFSETFROM:+0100 TZOFFSETTO:+0200 TZNAME:CEST END:DAYLIGHT END:VTIMEZONE

Parameters

object $calendar

iCalcreator calendar instance

string $timezone

PHP5 (DateTimeZone) valid timezone

array $xProp

*[x-propName => x-propValue], optional

integer $from

unix timestamp

integer $to

unix timestamp

Returns

boolean

_date2strdate()

_date2strdate(array  $datetime, integer  $parno = 6) : string

creates formatted output for calendar component property data value type date/date-time

Parameters

array $datetime
integer $parno

optional, default 6

Returns

string

_duration2arr()

_duration2arr(array  $duration) : array

ensures internal duration format for input in array format

Parameters

array $duration

Returns

array

_duration2date()

_duration2date(array  $startdate, array  $duration) : \array,

convert startdate+duration to a array format datetime

Parameters

array $startdate
array $duration

Returns

\array, —

date format

_durationStr2arr()

_durationStr2arr(string  $duration) : array

ensures internal duration format for an input string (iCal) formatted duration

Parameters

string $duration

Returns

array

_duration2str()

_duration2str(array  $duration) : string

creates formatted output for calendar component property data value type duration

Parameters

array $duration

Returns

string

_existRem()

_existRem(array  $array, string  $expkey, string  $expval = FALSE, integer  $hitVal = null, integer  $elseVal = null, integer  $preSet = null) : integer

removes expkey+expvalue from array and returns hitval (if found) else returns elseval

Parameters

array $array

iCal property parameters

string $expkey

expected key

string $expval

expected value

integer $hitVal

return value if found

integer $elseVal

return value if not found

integer $preSet

return value if already preset

Returns

integer

_inScope()

_inScope(object  $start, object  $scopeStart, object  $end, object  $scopeEnd, string  $format) : boolean

check if dates are in scope

Parameters

object $start

datetime

object $scopeStart

datetime

object $end

datetime

object $scopeEnd

datetime

string $format

Returns

boolean

_geo2str2()

_geo2str2(float  $ll, string  $format) : string

mgnt geo part output

Parameters

float $ll
string $format

Returns

string

_isArrayDate()

_isArrayDate(array  $input) : boolean

checks if input contains a (array formatted) date/time

Parameters

array $input

Returns

boolean

_isArrayTimestampDate()

_isArrayTimestampDate(array  $input) : boolean

checks if input array contains a timestamp date

Parameters

array $input

Returns

boolean

_isOffset()

_isOffset(string  $input) : boolean

controls if input string contains (trailing) UTC/iCal offset

Parameters

string $input

Returns

boolean

ms2phpTZ()

ms2phpTZ(string  $timezone) : boolean

(very simple) conversion of a MS timezone to a PHP5 valid (Date-)timezone matching (MS) UCT offset and time zone descriptors

Parameters

string $timezone

to convert

Returns

boolean

offsetSec2His()

offsetSec2His(string  $seconds) : string

transforms offset in seconds to [-/+]hhmm[ss]

Parameters

string $seconds

Returns

string

_recur2date()

_recur2date(array  $result, array  $recur, mixed  $wdate, mixed  $fcnStart, mixed  $fcnEnd = FALSE) : void

updates an array with dates based on a recur pattern

if missing, UNTIL is set 1 year from startdate (emergency break)

Parameters

array $result

array to update, array([Y-m-d] => bool)

array $recur

pattern for recurrency (only value part, params ignored)

mixed $wdate

component start date, string / array / (datetime) obj

mixed $fcnStart

start date, string / array / (datetime) obj

mixed $fcnEnd

end date, string / array / (datetime) obj

_recurBYcntcheck()

_recurBYcntcheck(array  $BYvalue, integer  $upValue, integer  $downValue) : boolean

_recur2date help function, checking BYDAY (etc) hits

Parameters

array $BYvalue
integer $upValue
integer $downValue

Returns

boolean

_recurIntervalIx()

_recurIntervalIx(string  $freq, array  $date, integer  $wkst) : boolean

_recur2date help function, (re-)calculate internal index

Parameters

string $freq
array $date
integer $wkst

Returns

boolean

_recurBydaySort()

_recurBydaySort(array  $bydaya, array  $bydayb) : integer

sort recur dates

Parameters

array $bydaya
array $bydayb

Returns

integer

_setRexrule()

_setRexrule(array  $rexrule) : array

convert input format for exrule and rrule to internal format

Parameters

array $rexrule

Returns

array

_setDate()

_setDate(mixed  $year, mixed  $month = FALSE, integer  $day = FALSE, integer  $hour = FALSE, integer  $min = FALSE, integer  $sec = FALSE, string  $tz = FALSE, array  $params = FALSE, string  $caller = null, string  $objName = null, string  $tzid = FALSE) : array

convert format for input date to internal date with parameters

Parameters

mixed $year
mixed $month

optional

integer $day

optional

integer $hour

optional

integer $min

optional

integer $sec

optional

string $tz

optional

array $params

optional

string $caller

optional

string $objName

optional

string $tzid

optional

Returns

array

_setDate2()

_setDate2(mixed  $year, mixed  $month = FALSE, integer  $day = FALSE, integer  $hour = FALSE, integer  $min = FALSE, integer  $sec = FALSE, array  $params = FALSE) : array

convert format for input date (UTC) to internal date with parameters

Parameters

mixed $year
mixed $month

optional

integer $day

optional

integer $hour

optional

integer $min

optional

integer $sec

optional

array $params

optional

Returns

array

_setMval()

_setMval(array  $valArr, mixed  $value, array  $params = FALSE, array  $defaults = FALSE, integer  $index = FALSE) : void

check index and set (an indexed) content in multiple value array

Parameters

array $valArr
mixed $value
array $params
array $defaults
integer $index

_setParams()

_setParams(array  $params, array  $defaults = FALSE) : array

set input (formatted) parameters- component property attributes

default parameters can be set, if missing

Parameters

array $params
array $defaults

Returns

array

_setSortArgs()

_setSortArgs(object  $c, string  $sortArg = FALSE) : void

set sort arguments/parameters in component

Parameters

object $c

valendar component

string $sortArg

_size75()

_size75(string  $string, string  $nl) : string

break lines at pos 75

Lines of text SHOULD NOT be longer than 75 octets, excluding the line break. Long content lines SHOULD be split into a multiple line representations using a line "folding" technique. That is, a long line can be split between any two characters by inserting a CRLF immediately followed by a single linear white space character (i.e., SPACE, US-ASCII decimal 32 or HTAB, US-ASCII decimal 9). Any sequence of CRLF followed immediately by a single linear white space character is ignored (i.e., removed) when processing the content type.

Edited 2007-08-26 by Anders Litzell, anders@litzell.se to fix bug where the reserved expression "\n" in the arg $string could be broken up by the folding of lines, causing ambiguity in the return string.

Parameters

string $string
string $nl

Returns

string

_sortExdate1()

_sortExdate1(array  $a, array  $b) : integer

sort callback function for exdate

Parameters

array $a
array $b

Returns

integer

_sortExdate2()

_sortExdate2(array  $a, array  $b) : integer

sort callback function for exdate

Parameters

array $a
array $b

Returns

integer

_sortRdate1()

_sortRdate1(array  $a, array  $b) : integer

sort callback function for rdate

Parameters

array $a
array $b

Returns

integer

_sortRdate2()

_sortRdate2(array  $a, array  $b) : integer

sort callback function for rdate

Parameters

array $a
array $b

Returns

integer

_splitContent()

_splitContent(string  $line, array  $propAttr = null) : void

separate property attributes from property value

Parameters

string $line

property content

array $propAttr

property parameters

_stepdate()

_stepdate(array  $date, string  $dateYMD, array  $step = array('day' => 1)) : void

step date, return updated date, array and timpstamp

Parameters

array $date

date to step

string $dateYMD

date YMD

array $step

default array( 'day' => 1 )

_strDate2arr()

_strDate2arr(mixed  $input) : \bool,

convert a date from specific string to array format

Parameters

mixed $input

Returns

\bool, —

TRUE on success

_strdate2date()

_strdate2date(array  $datetime, integer  $parno = FALSE, \moxed  $wtz = null) : array

ensures internal date-time/date format for input date-time/date in string fromat

Parameters

array $datetime
integer $parno

optional, default FALSE

\moxed $wtz

optional, default null

Returns

array

_strrep()

_strrep(string  $string, string  $format, string  $nl) : string

special characters management output

Parameters

string $string
string $format
string $nl

Returns

string

_strunrep()

_strunrep(string  $string) : string

special characters management input (from iCal file)

Parameters

string $string

Returns

string

_timestamp2date()

_timestamp2date(mixed  $timestamp, integer  $parno = 6, string  $wtz = null) : array

convert timestamp to date array, default UTC or adjusted for offset/timezone

Parameters

mixed $timestamp
integer $parno
string $wtz

Returns

array

transformDateTime()

transformDateTime(mixed  $date, string  $tzFrom, string  $tzTo = 'UTC', string  $format = 'Ymd\THis') : boolean

transforms a dateTime from a timezone to another using PHP DateTime and DateTimeZone class (PHP >= PHP 5.2.0)

Parameters

mixed $date

date to alter

string $tzFrom

PHP valid 'from' timezone

string $tzTo

PHP valid 'to' timezone, default 'UTC'

string $format

date output format, default 'Ymd\THis'

Returns

boolean

_tz2offset()

_tz2offset(string  $tz) : integer

convert offset, [+/-]HHmm[ss], to seconds, used when correcting UTC to localtime or v.v.

Parameters

string $tz

Returns

integer

__construct()

__construct() 

Private constructor to limit object instantiation to within the class