PHPackages                             xp-forge/ical - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. xp-forge/ical

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

xp-forge/ical
=============

iCalendar

v4.2.0(2y ago)02.9kBSD-3-ClausePHPPHP &gt;=7.0.0

Since Jun 23Pushed 2y ago1 watchersCompare

[ Source](https://github.com/xp-forge/ical)[ Packagist](https://packagist.org/packages/xp-forge/ical)[ Docs](http://xp-framework.net/)[ RSS](/packages/xp-forge-ical/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (22)Used By (0)

iCal: Calendar and events
=========================

[](#ical-calendar-and-events)

[![Build status on GitHub](https://github.com/xp-forge/ical/workflows/Tests/badge.svg)](https://github.com/xp-forge/ical/actions)[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)[![Requires PHP 7.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_0plus.svg)](http://php.net/)[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)[![Latest Stable Version](https://camo.githubusercontent.com/616fd353ae57ea2c76a82f384636b0e090f2ea956e3d2d1a15d40ee4df6ec59b/68747470733a2f2f706f7365722e707567782e6f72672f78702d666f7267652f6963616c2f76657273696f6e2e706e67)](https://packagist.org/packages/xp-forge/ical)

I/O
---

[](#io)

Calendars can be read and written using the ICalendar class

```
use text\ical\ICalendar;
use util\cmd\Console;
use io\File;

$ical= new ICalendar();

$calendar= $ical->read('BEGIN:VCALENDAR...');
$calendar= $ical->read(Console::$in->stream());
$calendar= $ical->read(new File('meeting.ics'));

$ical->write($calendar, Console::$out->stream());
$ical->write($calendar, new File('meeting.ics'));
```

Events
------

[](#events)

Typically a calendar contains one event, though the format allows any number, including none at all.

Using first event, typical use-case:

```
$event= $calendar->events()->first();
```

To prevent a `lang.ElementNotFoundException` when no event is present, check first:

```
$events= $calendar->events();
if ($events->present()) {
  $event= $events->first();
} else {
  // Handle situation when no events are inside calendar
}
```

Process all events:

```
foreach ($calendar->events() as $event) {
  // ...
}
```

Creation
--------

[](#creation)

Calendar instances can be created using a fluent interface

```
use text\ical\{
  Calendar,
  Event,
  Organizer,
  Attendee,
  IDate,
  Text,
  Method,
  Role,
  PartStat
};

$calendar= Calendar::with()
  ->method(Method::REQUEST)
  ->prodid('Microsoft Exchange Server 2010')
  ->version('2.0')
  ->events([Event::with()
    ->organizer(new Organizer('The Organizer', 'MAILTO:organizer@example.com'))
    ->attendees([
      Attendee::with()
        ->role(Role::CHAIR)
        ->partstat(PartStat::NEEDS_ACTION)
        ->rsvp('TRUE')
        ->cn('The Attendee 1')
        ->value('MAILTO:attendee2@example.com')
        ->create()
      ,
      Attendee::with()
        ->role(Role::REQ_PARTICIPANT)
        ->partstat(PartStat::NEEDS_ACTION)
        ->rsvp('TRUE')
        ->cn('The Attendee 2')
        ->value('MAILTO:attendee3@example.com')
        ->create()
    ])
    ->dtstart(new IDate(null, '20160524T183000Z'))
    ->dtend(new IDate(null, '20160524T190000Z'))
    ->location(new Text('de-DE', 'BS 50 EG 0102'))
    ->summary(new Text('de-DE', 'Treffen'))
    ->create()
  ])
  ->create()
;
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~148 days

Recently: every ~360 days

Total

20

Last Release

830d ago

Major Versions

v0.9.1 → v1.0.02017-05-01

v1.0.0 → v2.0.02017-06-04

v2.1.2 → v3.0.02020-04-10

v3.0.0 → v4.0.02021-10-24

PHP version history (2 changes)v0.1.0PHP &gt;=5.6.0

v3.0.0PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/07d18d882c8b4aaf3466432f64018214f2771eda333202175431ee7233795376?d=identicon)[thekid](/maintainers/thekid)

---

Top Contributors

[![thekid](https://avatars.githubusercontent.com/u/696742?v=4)](https://github.com/thekid "thekid (160 commits)")

---

Tags

calendaricalphpxp-frameworkmodulexp

### Embed Badge

![Health badge](/badges/xp-forge-ical/health.svg)

```
[![Health](https://phpackages.com/badges/xp-forge-ical/health.svg)](https://phpackages.com/packages/xp-forge-ical)
```

###  Alternatives

[xp-framework/compiler

XP Compiler

1926.8k9](/packages/xp-framework-compiler)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
