<?php define("__FORM__", "Application\\Form\\Type\\"); define("__ENTITY__", "Application\\Model\\Entity\\"); use Silex\Application; use Zend\Loader\StandardAutoloader; use Zend\Loader\ClassMapAutoloader; use Symfony\Component\Config\FileLocator; use Symfony\Component\Routing\RouteCollection; use Symfony\Component\Routing\Loader\YamlFileLoader; $standarAutoloader = new StandardAutoloader(); $classmapAutoloader = new ClassMapAutoloader(); $standarAutoloader->registerNamespaces(array('Application\\' => __DIR__ . '/../')); $classmapAutoloader->registerAutoloadMap(array('PHPExcel' => __DIR__ . '/../../lib/excel/PHPExcel.php', 'PHPMailer' => __DIR__ . '/../../lib/mailer/phpmailer.php', 'SMTP' => __DIR__ . '/../../lib/mailer/class.smtp.php', 'vcalendar' => __DIR__ . '/../../lib/calendar/ical/iCalcreator.class.php')); $standarAutoloader->register(); $classmapAutoloader->register(); $app["debug"] = true; $c = new \vcalendar(array('unique_id' => $_SERVER['HTTP_HOST'])); $t =& $c->newComponent('vtodo'); $t->setProperty('dtstart', '19970415T133000 GMT'); $t->setProperty('due', '19970416T045959 GMT'); $t->setProperty('summary', '1996 Income Tax Preparation'); $t->setProperty('class', 'CONFIDENTIAL'); $t->setProperty('categories', 'FAMILY'); $t->setProperty('categories', 'FINANCE'); $t->setProperty('priority', 1); $t->setProperty('status', 'NEEDS-ACTION'); $str = $c->createCalendar(); $calendarPath = __DIR__ . '/../tmp/Calendar'; file_put_contents($calendarPath . '/sample.ics', $str); //echo $str;