12 Currently it just generates events
in a single calendar.
14 The iCalendar output goes to stdout. Other messages to stderr.
28 include __DIR__ .
'/../vendor/autoload.php';
30 fwrite(STDERR,
"Generating " .
$events .
" events\n");
43 $event->DTSTART =
'bla';
44 $event->SUMMARY =
'Event #' .
$ii;
45 $event->UID = md5(microtime(
true));
47 $doctorRandom = mt_rand(1, 1000);
49 switch ($doctorRandom) {
52 $event->DTEND =
'bla';
55 $dtEnd->modify(
'+' . mt_rand(1, 3) .
' days');
56 $event->DTSTART->setDateTime($dtStart);
57 $event->DTSTART[
'VALUE'] =
'DATE';
58 $event->DTEND->setDateTime($dtEnd);
61 $event->RRULE =
'FREQ=DAILY;COUNT=' . mt_rand(1, 10);
65 $dtStart->setTime(mt_rand(1, 23), mt_rand(0, 59), mt_rand(0, 59));
66 $event->DTSTART->setDateTime($dtStart);
67 $event->DURATION =
'PT' . mt_rand(1, 3) .
'H';
75 fwrite(STDERR,
"Validating\n");
79 fwrite(STDERR,
"Errors!\n");
80 fwrite(STDERR, print_r(
$result,
true));
84 fwrite(STDERR,
"Serializing this beast\n");
88 fwrite(STDERR,
"done.\n");