ICS Parser

A PHP library that parses iCalendar (.ics/.ical/.ifb) files into structured event data with timezone-aware dates.

Library
Composer
vv3.5.1
482stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
73/100Good
Development Activity68
Maintenance60
Community84
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
66/100Good
Architecture68
Code Quality70
Innovation55
Learning Curve72

ICS Parser reads iCalendar files (.ics, .ical, .ifb) and turns their raw key/value structure into a PHP associative array of calendar and event data, resolving DateTime objects with IANA/Unicode CLDR/Windows timezone data applied. It’s a long-running, community-maintained fork (originally by John Grogg, now maintained under the u01jmg3 GitHub account, while keeping the johngrogg/ics-parser Packagist name for backward compatibility) used across scheduling and calendar-integration tools.

What You Get

  • An ICal class that parses .ics/.ical/.ifb files (or raw strings) into calendar and event associative arrays
  • Automatic timezone resolution using IANA, Unicode CLDR, or Windows timezone data, exposed via dtstart_tz/dtend_tz
  • PHP DateTime object generation for date/time properties wherever the format allows it
  • {property}_array companion fields that further resolve structured properties beyond the raw string value
  • Support for recurring events via relative date format parsing (with documented limits on complex BYDAY+BYSETPOS rules)

Common Use Cases

  • Importing external calendar feeds (Google Calendar exports, Outlook .ics attachments) into a PHP application’s own event model
  • Building calendar-sync integrations that need to read third-party .ics feeds and normalize them to local timezones
  • Displaying upcoming events from a subscribed iCalendar feed on a website or dashboard
  • Validating and inspecting .ics files programmatically as part of a scheduling or booking tool’s ingestion pipeline

Under The Hood

Architecture: The library is deliberately small — two classes, ICal (the parser/entry point) and Event (a typed wrapper around a single VEVENT) — with ICal handling file/string ingestion, line-unfolding, key/value tokenizing per the iCalendar grammar, and timezone/date post-processing in one pass. Tech Stack: Pure PHP with no runtime dependencies, supporting PHP back to 5.6.40 for legacy compatibility while its dev tooling (phpstan, rector, ecs) targets modern PHP standards, reflecting a codebase that serves both old and current PHP deployments. Code Quality: The repo runs PHPStan static analysis, Rector for automated upgrades, and Easy Coding Standard (ecs) for style enforcement, alongside a PHPUnit test suite (composer test) and example scripts under examples/ that double as informal integration tests. API Design: The public surface is intentionally simple — instantiate ICal with a file path or string, then call ->events() or read ->cal — but the README is explicit about edge cases (relative date format limits, the Packagist-name-vs-GitHub-owner mismatch), which is unusually good practice honesty for a small utility library.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search