Home  Kontakt  Impressum  

PHP iCalWriter
 
A set of classes to create iCalender (.ics) files
iCalWriter is meant to create .ics files in a simple way. Meaning without or with as little knowledge as possible of RFC 2445, in which the iCalender-format is described. To do this iCalWriter has a set of classes the allow the simple creation of iCalender-files. There is a base-class iCalWriter and other classes for events, alarms, todo-items and so on.
At the moment only the iCalWriter and iCalEvent classes exists.
iCalWriter is published under the GNU Library or Lesser General Public License (LGPL). It is hosted on sourceforge. If you are interested you are welcome to contribute to this project.
Usage of the classes is simple. You need to include the iCalWriter.php file:
require_once("iCalWriter.php");
Then create an iCalWriter-object and set some basic stuff:
$iCal = new iCalWriter;
$iCal->setDownloadOutput();
$iCal->setFileName("test.ics");

Now we can start with our output:
$iCal->start();
To add event-data you need an iCalEvent-object:
$iEvent = new iCalEvent;
A lot of stuff to set here. So here are just a few examples:
$iEvent->setStart("2008", "02", "10", 0, 1, "", 1, "14", "12");
$iEvent->setEnd("2008", "02", "12", 1, 0, "", 1, "12");
$iEvent->setShortDescription("testing");

Lets add the event to the iCalWriter-object:
$iCal->add($iEvent);
We could add more events here.
Finally we want to end the output by:
$iCal->end();
More documentation will (soon) be available on the sourceforge page. Or have a look at the code. Everything should be quite well commented.
Visit the iCalWriter page on sourceforge.