PHP - On the fly file generation.
Posted: Thu Oct 27, 2011 4:19 pm
Hi guys,
I've read that you can generate files on the fly with PHP such as PDF ect, but can it handle any file extension? I'd like to create custom .ics files (iCal invites for Mac). They're really straight forward and are formated like this:
[syntax]BEGIN:VCALENDAR
CALSCALE:GREGORIAN
VERSION:2.0
X-WR-CALNAME:1012
METHOD:PUBLISH
PRODID:-//Apple Inc.//iCal 5.0.1//EN
BEGIN:VTIMEZONE
TZID:Europe/London
BEGIN:DAYLIGHT
TZOFFSETFROM:+0000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
DTSTART:19810329T010000
TZNAME:BST
TZOFFSETTO:+0100
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0100
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
DTSTART:19961027T020000
TZNAME:GMT
TZOFFSETTO:+0000
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
CREATED:20111027T210619Z
UID:2C185D57-1B0D-400E-8CD6-96A4422D48F5
DTEND;TZID=Europe/London:20111025T043000
TRANSP:OPAQUE
SUMMARY:1012
DTSTART;TZID=Europe/London:20111025T041500
DTSTAMP:20111027T210641Z
LOCATION:
SEQUENCE:3
URL;VALUE=URI:
ty_number=
END:VEVENT
END:VCALENDAR
[/syntax]
I've edited one I created with iCal in TextWrangler and saved it as a .ics file which works just fine.
Could I have PHP generate the file based on a number of variables passed to it? If so how do you get PHP to do this?
I've read that you can generate files on the fly with PHP such as PDF ect, but can it handle any file extension? I'd like to create custom .ics files (iCal invites for Mac). They're really straight forward and are formated like this:
[syntax]BEGIN:VCALENDAR
CALSCALE:GREGORIAN
VERSION:2.0
X-WR-CALNAME:1012
METHOD:PUBLISH
PRODID:-//Apple Inc.//iCal 5.0.1//EN
BEGIN:VTIMEZONE
TZID:Europe/London
BEGIN:DAYLIGHT
TZOFFSETFROM:+0000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
DTSTART:19810329T010000
TZNAME:BST
TZOFFSETTO:+0100
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0100
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
DTSTART:19961027T020000
TZNAME:GMT
TZOFFSETTO:+0000
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
CREATED:20111027T210619Z
UID:2C185D57-1B0D-400E-8CD6-96A4422D48F5
DTEND;TZID=Europe/London:20111025T043000
TRANSP:OPAQUE
SUMMARY:1012
DTSTART;TZID=Europe/London:20111025T041500
DTSTAMP:20111027T210641Z
LOCATION:
SEQUENCE:3
URL;VALUE=URI:
ty_number=
END:VEVENT
END:VCALENDAR
[/syntax]
I've edited one I created with iCal in TextWrangler and saved it as a .ics file which works just fine.
Could I have PHP generate the file based on a number of variables passed to it? If so how do you get PHP to do this?