2017 © Pedro Peláez
 

library ical

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 5545 as best as possible.

image

eluceo/ical

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 5545 as best as possible.

  • Wednesday, May 2, 2018
  • by markuspoerschke
  • Repository
  • 29 Watchers
  • 453 Stars
  • 1,386,965 Installations
  • PHP
  • 25 Dependents
  • 0 Suggesters
  • 96 Forks
  • 20 Open issues
  • 29 Versions
  • 9 % Grown

The README.md

📅 eluceo — iCal 2

Continuous Integration codecov Psalm coverage License Latest Stable Version Monthly Downloads Infection MSI, (*1)

This package offers an abstraction layer for creating iCalendars files. By using this PHP package, you can create *.ics files without the knowledge of the underling format. The output itself will follow RFC 5545 as good as possible., (*2)

Installation

You can install this package by using Composer, running the following command:, (*3)

composer require eluceo/ical

Version / Upgrade

The initial version was released back in 2012. The version 2 of this package is a complete rewrite of the package and is not compatible to older version. Please see the upgrade guide if you want to migrate from version 0.* to 2.*. If you just start using this package, you should install version 2., (*4)

Version PHP Version
2.* 7.4 - 8.3
0.16.* 7.0 - 8.2
0.11.* 5.3.0 - 7.4

Documentation

Visit ical.poerschke.nrw for complete documentation., (*5)

Usage

The classes within this package are grouped into two namespaces:, (*6)

  • The Domain contains the information about the events.
  • The Presentation contains the transformation from Domain into a *.ics file.

To create a calendar, the first step will be to create the corresponding domain objects. Then these objects can be transformed into a iCalendar PHP representation, which can be cast to string., (*7)

Empty event

In this very basic example, that renders an empty event. You will learn how to create an event domain object, how to add it to a calendar and how to transform it to a iCalendar component., (*8)

1. Create an event domain entity

$event = new \Eluceo\iCal\Domain\Entity\Event();

2. Create a calendar domain entity

$calendar = new \Eluceo\iCal\Domain\Entity\Calendar([$event]);

3. Transform calendar domain object into a presentation object

$iCalendarComponent = (new \Eluceo\iCal\Presentation\Factory\CalendarFactory())->createCalendar($calendar);

4. a) Save to file

file_put_contents('calendar.ics', (string) $iCalendarComponent);

4. b) Send via HTTP

header('Content-Type: text/calendar; charset=utf-8');
header('Content-Disposition: attachment; filename="cal.ics"');

echo $iCalendarComponent;

Full example

The following example will create a single day event with a summary and a description. More examples can be found in the examples/ folder., (*9)

<?php

require_once __DIR__ . '/../vendor/autoload.php';

// 1. Create Event domain entity
$event = (new Eluceo\iCal\Domain\Entity\Event())
    ->setSummary('Christmas Eve')
    ->setDescription('Lorem Ipsum Dolor...')
    ->setOccurrence(
        new Eluceo\iCal\Domain\ValueObject\SingleDay(
            new Eluceo\iCal\Domain\ValueObject\Date(
                \DateTimeImmutable::createFromFormat('Y-m-d', '2030-12-24')
            )
        )
    );

// 2. Create Calendar domain entity
$calendar = new Eluceo\iCal\Domain\Entity\Calendar([$event]);

// 3. Transform domain entity into an iCalendar component
$componentFactory = new Eluceo\iCal\Presentation\Factory\CalendarFactory();
$calendarComponent = $componentFactory->createCalendar($calendar);

// 4. Set headers
header('Content-Type: text/calendar; charset=utf-8');
header('Content-Disposition: attachment; filename="cal.ics"');

// 5. Output
echo $calendarComponent;

License

This package is released under the MIT license., (*10)

The Versions

02/05 2018

dev-master

9999999-dev https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 5545 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

calendar ics ical icalendar php calendar

30/04 2018

0.11.x-dev

0.11.9999999.9999999-dev https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

calendar ics ical icalendar php calendar

30/04 2018

0.11.6

0.11.6.0 https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

calendar ics ical icalendar php calendar

13/03 2018

0.14.0

0.14.0.0 https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 5545 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

calendar ics ical icalendar php calendar

13/03 2018

0.11.5

0.11.5.0 https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 5545 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

calendar ics ical icalendar php calendar

26/10 2017

0.13.0

0.13.0.0 https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 5545 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

calendar ics ical icalendar php calendar

26/10 2017

0.11.4

0.11.4.0 https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

calendar ics ical icalendar php calendar

07/06 2017

0.12.1

0.12.1.0 https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 5545 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

calendar ics ical icalendar php calendar

10/05 2017

0.12.0

0.12.0.0 https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 5545 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

calendar ics ical icalendar php calendar

25/04 2017

0.11.3

0.11.3.0 https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

calendar ics ical icalendar php calendar

21/04 2017

0.11.2

0.11.2.0 https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

calendar ics ical icalendar php calendar

04/04 2017

0.11.1

0.11.1.0 https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

calendar ics ical icalendar php calendar

16/09 2016

0.11.0

0.11.0.0 https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

calendar ics ical icalendar php calendar

09/06 2016

0.10.1

0.10.1.0 https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

calendar ics ical icalendar php calendar

26/04 2016

1.x-dev

1.9999999.9999999.9999999-dev https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

calendar ics ical icalendar php calendar

26/04 2016

0.10.0

0.10.0.0 https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

calendar ics ical icalendar php calendar

13/11 2015

0.9.0

0.9.0.0 https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

calendar ics ical icalendar php calendar

12/07 2015

0.8.0

0.8.0.0 https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

calendar ics ical icalendar php calendar

22/02 2015

0.7.0

0.7.0.0 https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

calendar ics ical icalendar php calendar

08/12 2014

0.6.1

0.6.1.0 https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

calendar ics ical icalendar php calendar

07/12 2014

0.6.0

0.6.0.0 https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

calendar ics ical icalendar php calendar

05/12 2014

0.5.0

0.5.0.0 https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

calendar ics ical icalendar php calendar

28/11 2014

v0.4.0

0.4.0.0 https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

calendar ics ical icalendar php calendar

11/09 2014

0.3.0

0.3.0.0 https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

calendar ics ical icalendar php calendar

03/09 2014

0.2.0

0.2.0.0 https://github.com/markuspoerschke/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

calendar ics ical icalendar php calendar

11/08 2014

0.1.3

0.1.3.0 https://github.com/eluceo/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

calendar ics ical icalendar php calendar

06/07 2014

0.1.2

0.1.2.0 https://github.com/eluceo/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

calendar ics ical icalendar php calendar

15/05 2014

0.1.1

0.1.1.0 https://github.com/eluceo/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

calendar ics ical icalendar php calendar

02/03 2014

0.1.0

0.1.0.0 https://github.com/eluceo/iCal

The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 2445 as best as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

calendar ics ical icalendar php calendar