{"id":13550979,"url":"https://github.com/markuspoerschke/iCal","last_synced_at":"2025-04-03T01:30:46.561Z","repository":{"id":4608708,"uuid":"5752129","full_name":"markuspoerschke/iCal","owner":"markuspoerschke","description":"iCal-creator for PHP","archived":false,"fork":false,"pushed_at":"2025-03-11T21:01:50.000Z","size":2909,"stargazers_count":1144,"open_issues_count":66,"forks_count":166,"subscribers_count":31,"default_branch":"2.x","last_synced_at":"2025-04-01T18:58:28.834Z","etag":null,"topics":["calendar","composer","hacktoberfest","ical","ics","php","rfc-5545"],"latest_commit_sha":null,"homepage":"https://ical.poerschke.nrw","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markuspoerschke.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-09-10T16:12:39.000Z","updated_at":"2025-03-21T14:59:08.000Z","dependencies_parsed_at":"2023-07-05T20:03:11.510Z","dependency_job_id":"5b8f3dd3-f11c-4ab4-8fb0-499e8d368aaa","html_url":"https://github.com/markuspoerschke/iCal","commit_stats":{"total_commits":593,"total_committers":72,"mean_commits":8.23611111111111,"dds":0.7386172006745362,"last_synced_commit":"3781cf11a56e1c96b8f53c4aee7bedfb40059014"},"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markuspoerschke%2FiCal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markuspoerschke%2FiCal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markuspoerschke%2FiCal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markuspoerschke%2FiCal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markuspoerschke","download_url":"https://codeload.github.com/markuspoerschke/iCal/tar.gz/refs/heads/2.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246709884,"owners_count":20821298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calendar","composer","hacktoberfest","ical","ics","php","rfc-5545"],"created_at":"2024-08-01T12:01:40.627Z","updated_at":"2025-04-03T01:30:46.521Z","avatar_url":"https://github.com/markuspoerschke.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# 📅 eluceo — iCal 2\n\n[![Continuous Integration](https://github.com/markuspoerschke/iCal/actions/workflows/ci.yml/badge.svg)](https://github.com/markuspoerschke/iCal/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/markuspoerschke/iCal/branch/2.x/graph/badge.svg)](https://codecov.io/gh/markuspoerschke/iCal)\n[![Psalm coverage](https://shepherd.dev/github/markuspoerschke/ical/coverage.svg?)](https://shepherd.dev/github/markuspoerschke/ical)\n[![License](https://poser.pugx.org/eluceo/ical/license)](https://packagist.org/packages/eluceo/ical)\n[![Latest Stable Version](https://poser.pugx.org/eluceo/ical/v/stable)](https://packagist.org/packages/eluceo/ical)\n[![Monthly Downloads](https://poser.pugx.org/eluceo/ical/d/monthly)](https://packagist.org/packages/eluceo/ical)\n[![Infection MSI](https://badge.stryker-mutator.io/github.com/markuspoerschke/iCal/2.x)](https://infection.github.io)\n\nThis package offers an abstraction layer for creating iCalendars files.\nBy using this PHP package, you can create `*.ics` files without the knowledge of the underling format.\nThe output itself will follow [RFC 5545](https://www.ietf.org/rfc/rfc5545.html) as good as possible.\n\n## Navigate through the project\n\n-   📖 [read the documentation](https://ical.poerschke.nrw)\n-   🐛 [report a bug or suggest a feature](https://github.com/markuspoerschke/iCal/issues)\n-   🙋 [raise a question](https://github.com/markuspoerschke/iCal/discussions/categories/q-a)\n-   💬 [start a discussion](https://github.com/markuspoerschke/iCal/discussions)\n\n## Installation\n\nYou can install this package by using [Composer](http://getcomposer.org), running the following command:\n\n```sh\ncomposer require eluceo/ical\n```\n\n## Version / Upgrade\n\nThe initial version was released back in 2012.\nThe version 2 of this package is a complete rewrite of the package and is not compatible to older version.\nPlease see the upgrade guide if you want to migrate from version `0.*` to `2.*`.\nIf you just start using this package, you should install version 2.\n\n| Version | PHP Version |\n| ------- | ----------- |\n| \u003e= 2.15 | 8.3 - 8.4   |\n| \\\u003c 2.14 | 7.4 - 8.3   |\n| 0.16.\\* | 7.0 - 8.2   |\n| 0.11.\\* | 5.3.0 - 7.4 |\n\n## Documentation\n\nVisit [ical.poerschke.nrw](https://ical.poerschke.nrw/) for complete documentation.\n\n## Usage\n\nThe classes within this package are grouped into two namespaces:\n\n-   The `Domain` contains the information about the events.\n-   The `Presentation` contains the transformation from `Domain` into a `*.ics` file.\n\nTo create a calendar, the first step will be to create the corresponding domain objects.\nThen these objects can be transformed into a iCalendar PHP representation, which can be cast to string.\n\n### Empty event\n\nIn this very basic example, that renders an empty event.\nYou 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.\n\n#### 1. Create an event domain entity\n\n```PHP\n$event = new \\Eluceo\\iCal\\Domain\\Entity\\Event();\n```\n\n#### 2. Create a calendar domain entity\n\n```PHP\n$calendar = new \\Eluceo\\iCal\\Domain\\Entity\\Calendar([$event]);\n```\n\n#### 3. Transform calendar domain object into a presentation object\n\n```PHP\n$iCalendarComponent = (new \\Eluceo\\iCal\\Presentation\\Factory\\CalendarFactory())-\u003ecreateCalendar($calendar);\n```\n\n#### 4. a) Save to file\n\n```PHP\nfile_put_contents('calendar.ics', (string) $iCalendarComponent);\n```\n\n#### 4. b) Send via HTTP\n\n```PHP\nheader('Content-Type: text/calendar; charset=utf-8');\nheader('Content-Disposition: attachment; filename=\"cal.ics\"');\n\necho $iCalendarComponent;\n```\n\n### Full example\n\nThe following example will create a single day event with a summary and a description.\nMore examples can be found in the [examples/](examples) folder.\n\n```php\n\u003c?php\n\nrequire_once __DIR__ . '/../vendor/autoload.php';\n\n// 1. Create Event domain entity\n$event = (new Eluceo\\iCal\\Domain\\Entity\\Event())\n    -\u003esetSummary('Christmas Eve')\n    -\u003esetDescription('Lorem Ipsum Dolor...')\n    -\u003esetOccurrence(\n        new Eluceo\\iCal\\Domain\\ValueObject\\SingleDay(\n            new Eluceo\\iCal\\Domain\\ValueObject\\Date(\n                \\DateTimeImmutable::createFromFormat('Y-m-d', '2030-12-24')\n            )\n        )\n    );\n\n// 2. Create Calendar domain entity\n$calendar = new Eluceo\\iCal\\Domain\\Entity\\Calendar([$event]);\n\n// 3. Transform domain entity into an iCalendar component\n$componentFactory = new Eluceo\\iCal\\Presentation\\Factory\\CalendarFactory();\n$calendarComponent = $componentFactory-\u003ecreateCalendar($calendar);\n\n// 4. Set headers\nheader('Content-Type: text/calendar; charset=utf-8');\nheader('Content-Disposition: attachment; filename=\"cal.ics\"');\n\n// 5. Output\necho $calendarComponent;\n```\n\n## License\n\nThis package is released under the [**MIT license**](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkuspoerschke%2FiCal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkuspoerschke%2FiCal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkuspoerschke%2FiCal/lists"}