PHPackages                             phpfui/icalendar - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. phpfui/icalendar

ActiveLibrary[File &amp; Storage](/categories/file-storage)

phpfui/icalendar
================

A modern fork of the icalendar.org PHP implementation of rfc5545, management of iCal formatted files

V1.1.1(6y ago)1412.7k↓12.5%8[2 issues](https://github.com/phpfui/icalendar/issues)GPL-3.0-or-laterPHPPHP &gt;=7.4 &lt;8.6

Since Oct 31Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/phpfui/icalendar)[ Packagist](https://packagist.org/packages/phpfui/icalendar)[ Docs](https://icalendar.org/php-library.html)[ RSS](/packages/phpfui-icalendar/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (4)Versions (15)Used By (0)

Zap Calendar iCalendar Library [![Tests](https://github.com/phpfui/icalendar/actions/workflows/tests.yml/badge.svg)](https://github.com/phpfui/icalendar/actions?query=workflow%3Atests) [![Latest Packagist release](https://camo.githubusercontent.com/f3897669c820776446fe2a1ffe8ff0d67029780fccb18438dc81342a80dcbde7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068706675692f6963616c656e6461722e737667)](https://packagist.org/packages/phpfui/icalendar) [![](https://camo.githubusercontent.com/742e8be8005b1fe76a64a5d8f5e6a5d4f63bf315e9a44a6d23e4e11c76b0555f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230362d627269676874677265656e2e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/742e8be8005b1fe76a64a5d8f5e6a5d4f63bf315e9a44a6d23e4e11c76b0555f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230362d627269676874677265656e2e7376673f7374796c653d666c6174)
=================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#zap-calendar-icalendar-library---)

A modern 7.4 namespaced fork of [Zap Calendar iCalendar Library](https://github.com/zcontent/icalendar)
-------------------------------------------------------------------------------------------------------

[](#a-modern-74-namespaced-fork-of-zap-calendar-icalendar-library)

The Zap Calendar iCalendar Library is a PHP library for supporting the iCalendar (RFC 5545) standard.

This PHP library is for reading and writing iCalendar formatted feeds and files. Features of the library include:

- Read AND write support for iCalendar files
- Object based creation and manipulation of iCalendar files
- Supports expansion of RRULE to a list of repeating dates
- Supports adding timezone info to iCalendar file

All iCalendar data is stored in a PHP object tree. This allows any property to be added to the iCalendar feed without requiring specialized library function calls. With power comes responsibility. Missing or invalid properties can cause the resulting iCalendar file to be invalid. Visit [iCalendar.org](http://icalendar.org) to view valid properties and test your feed using the site's [iCalendar validator tool](http://icalendar.org/validator.html).

Library API documentation can be found at  and [PHPFUI/ICalendarOrg](http://phpfui.com/?n=ICalendarOrg)

See the examples folder for programs that read and write iCalendar files. Best to include the sample files into a file with an active autoloader or include all the classes to run the examples directly.

Create an ical object using the ZCiCal object:

```
$icalobj = new \ICalendarOrg\ZCiCal();
```

Add an event object:

```
$eventobj = new \ICalendarOrg\ZCiCalNode("VEVENT", $icalobj->curnode);
```

Add a start and end date to the event:

```
// add start date
$eventobj->addNode(new \ICalendarOrg\ZCiCalDataNode("DTSTART:" . \ICalendarOrg\ZDateHelper::fromSqlDateTime("2020-01-01 12:00:00")));

// add end date
$eventobj->addNode(new \ICalendarOrg\ZCiCalDataNode("DTEND:" . \ICalendarOrg\ZDateHelper::fromSqlDateTime("2020-01-01 13:00:00")));
```

Write the object in iCalendar format using the export() function call:

```
echo $icalobj->export();
```

This example will not validate since it is missing some required elements. Look at the simpleevent.php example for the minimum # of elements needed for a validated iCalendar file.

To create a multi-event iCalendar file, simply create multiple event objects. For example:

```
$icalobj = new \ICalendarOrg\ZCiCal();
$eventobj1 = new \ICalendarOrg\ZCiCalNode("VEVENT", $icalobj->curnode);
$eventobj1->addNode(new \ICalendarOrg\ZCiCalDataNode("SUMMARY:Event 1"));
...
$eventobj2 = new \ICalendarOrg\ZCiCalNode("VEVENT", $icalobj->curnode);
$eventobj2->addNode(new \ICalendarOrg\ZCiCalDataNode("SUMMARY:Event 2"));
...
```

To read an existing iCalendar file/feed, create the ZCiCal object with a string representing the contents of the iCalendar file:

```
$icalobj = new \ICalendarOrg\ZCiCal($icalstring);
```

Large iCalendar files can be read in chunks to reduce the amount of memory needed to hold the iCalendar feed in memory. This example reads 500 events at a time:

```
$icalobj = null;
$eventcount = 0;
$maxevents = 500;
do
{
	$icalobj = new \ICalendarOrg\ZCiCal($icalstring, $maxevents, $eventcount);
	...
	$eventcount += $maxevents;
}
while($icalobj->countEvents() >= $eventcount);
```

You can read the events from an imported (or created) iCalendar object in this manner:

```
foreach($icalobj->tree->child as $node)
{
	if($node->getName() == "VEVENT")
	{
		foreach($node->data as $key => $value)
		{
			if($key == "SUMMARY")
			{
				echo "event title: " . $value->getValues() . "\n";
			}
		}
	}
}
```

Known Limitations
-----------------

[](#known-limitations)

- Since the library utilizes objects to read and write iCalendar data, the size of the iCalendar data is limited to the amount of available memory on the machine. The ZCiCal() object supports reading a range of events to minimize memory space.
- The library ignores timezone info when importing files, instead utilizing PHP's timezone library for calculations (timezones are supported when exporting files). Imported timezones need to be aliased to a [PHP supported timezone](http://php.net/manual/en/timezones.php).
- At this time, the library does not support the "BYSETPOS" option in RRULE items.

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance44

Moderate activity, may be stable

Popularity35

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 80% 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 ~0 days

Total

14

Last Release

2392d ago

PHP version history (5 changes)V1.0.0PHP &gt;=7.4 &lt;8.2

V1.0.10PHP &gt;=7.4 &lt;8.4

V1.0.11PHP &gt;=7.4 &lt;8.5

V1.0.5PHP &gt;=7.4 &lt;8.3

V1.1.1PHP &gt;=7.4 &lt;8.6

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7434059?v=4)[Bruce Wells](/maintainers/PHPFUI)[@phpfui](https://github.com/phpfui)

---

Top Contributors

[![phpfui](https://avatars.githubusercontent.com/u/7434059?v=4)](https://github.com/phpfui "phpfui (48 commits)")[![cogliano](https://avatars.githubusercontent.com/u/11013522?v=4)](https://github.com/cogliano "cogliano (11 commits)")[![tanabi](https://avatars.githubusercontent.com/u/6575637?v=4)](https://github.com/tanabi "tanabi (1 commits)")

---

Tags

filestandardiCalendarrfc5545rfc6321vCalendarcalendarmanagementrfc2445veventvtodovjournalvfreebusyvalarmvtimezonedaylight

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phpfui-icalendar/health.svg)

```
[![Health](https://phpackages.com/badges/phpfui-icalendar/health.svg)](https://phpackages.com/packages/phpfui-icalendar)
```

###  Alternatives

[kigkonsult/icalcreator

iCalcreator is the PHP implementation of rfc2445/rfc5545 and rfc updates, management of calendar information

2462.6M16](/packages/kigkonsult-icalcreator)[league/flysystem

File storage abstraction for PHP

13.6k639.1M2.2k](/packages/league-flysystem)[sabre/vobject

The VObject library for PHP allows you to easily parse and manipulate iCalendar and vCard objects

59623.5M41](/packages/sabre-vobject)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M790](/packages/league-flysystem-aws-s3-v3)[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[knplabs/knp-gaufrette-bundle

Allows to easily use the Gaufrette library in a Symfony project

72528.6M91](/packages/knplabs-knp-gaufrette-bundle)

PHPackages © 2026

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