#!/usr/bin/env php fatal('No file specified on the command line.'); } $input_file = $argv[1]; if (!file_exists($input_file)) { $cli->fatal($input_file . ' does not exist.'); } if (!is_readable($input_file)) { $cli->fatal($input_file . ' is not readable.'); } $cli->writeln($cli->blue('Parsing ' . $input_file . ' ...')); $data = file_get_contents($input_file); $ical = new Horde_Icalendar(); if (!$ical->parseVCalendar($data)) { $cli->fatal('iCalendar parsing failed.'); } $cli->writeln($cli->green('Parsing successful, found ' . $ical->getComponentCount() . ' component(s).')); $components = $ical->getComponents(); foreach ($components as $component) { var_dump($component->toHash(true)); }