{"id":18550315,"url":"https://github.com/xp-forge/ical","last_synced_at":"2025-10-10T04:37:38.140Z","repository":{"id":57084817,"uuid":"61722282","full_name":"xp-forge/ical","owner":"xp-forge","description":"Calendar and events","archived":false,"fork":false,"pushed_at":"2024-03-24T10:45:09.000Z","size":168,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-12T23:02:12.451Z","etag":null,"topics":["calendar","ical","php","xp-framework"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xp-forge.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":null,"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}},"created_at":"2016-06-22T13:42:21.000Z","updated_at":"2021-10-24T15:43:21.000Z","dependencies_parsed_at":"2024-03-01T21:49:24.091Z","dependency_job_id":null,"html_url":"https://github.com/xp-forge/ical","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-forge%2Fical","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-forge%2Fical/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-forge%2Fical/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-forge%2Fical/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xp-forge","download_url":"https://codeload.github.com/xp-forge/ical/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254319722,"owners_count":22051075,"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","ical","php","xp-framework"],"created_at":"2024-11-06T21:04:11.917Z","updated_at":"2025-10-10T04:37:38.083Z","avatar_url":"https://github.com/xp-forge.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"iCal: Calendar and events\n=========================\n\n[![Build status on GitHub](https://github.com/xp-forge/ical/workflows/Tests/badge.svg)](https://github.com/xp-forge/ical/actions)\n[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)\n[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)\n[![Requires PHP 7.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_0plus.svg)](http://php.net/)\n[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)\n[![Latest Stable Version](https://poser.pugx.org/xp-forge/ical/version.png)](https://packagist.org/packages/xp-forge/ical)\n\nI/O\n---\nCalendars can be read and written using the ICalendar class\n\n```php\nuse text\\ical\\ICalendar;\nuse util\\cmd\\Console;\nuse io\\File;\n\n$ical= new ICalendar();\n\n$calendar= $ical-\u003eread('BEGIN:VCALENDAR...');\n$calendar= $ical-\u003eread(Console::$in-\u003estream());\n$calendar= $ical-\u003eread(new File('meeting.ics'));\n\n$ical-\u003ewrite($calendar, Console::$out-\u003estream());\n$ical-\u003ewrite($calendar, new File('meeting.ics'));\n```\n\nEvents\n------\nTypically a calendar contains one event, though the format allows any number, including none at all.\n\nUsing first event, typical use-case:\n```php\n$event= $calendar-\u003eevents()-\u003efirst();\n```\n\nTo prevent a `lang.ElementNotFoundException` when no event is present, check first:\n```php\n$events= $calendar-\u003eevents(); \nif ($events-\u003epresent()) {\n  $event= $events-\u003efirst();\n} else {\n  // Handle situation when no events are inside calendar\n}\n```\n\nProcess all events:\n```php\nforeach ($calendar-\u003eevents() as $event) {\n  // ...\n}\n```\n\nCreation\n--------\nCalendar instances can be created using a fluent interface\n\n```php\nuse text\\ical\\{\n  Calendar,\n  Event,\n  Organizer,\n  Attendee,\n  IDate,\n  Text,\n  Method,\n  Role,\n  PartStat\n};\n\n$calendar= Calendar::with()\n  -\u003emethod(Method::REQUEST)\n  -\u003eprodid('Microsoft Exchange Server 2010')\n  -\u003eversion('2.0')\n  -\u003eevents([Event::with()\n    -\u003eorganizer(new Organizer('The Organizer', 'MAILTO:organizer@example.com'))\n    -\u003eattendees([\n      Attendee::with()\n        -\u003erole(Role::CHAIR)\n        -\u003epartstat(PartStat::NEEDS_ACTION)\n        -\u003ersvp('TRUE')\n        -\u003ecn('The Attendee 1')\n        -\u003evalue('MAILTO:attendee2@example.com')\n        -\u003ecreate()\n      ,\n      Attendee::with()\n        -\u003erole(Role::REQ_PARTICIPANT)\n        -\u003epartstat(PartStat::NEEDS_ACTION)\n        -\u003ersvp('TRUE')\n        -\u003ecn('The Attendee 2')\n        -\u003evalue('MAILTO:attendee3@example.com')\n        -\u003ecreate()\n    ])\n    -\u003edtstart(new IDate(null, '20160524T183000Z'))\n    -\u003edtend(new IDate(null, '20160524T190000Z'))\n    -\u003elocation(new Text('de-DE', 'BS 50 EG 0102'))\n    -\u003esummary(new Text('de-DE', 'Treffen'))\n    -\u003ecreate()\n  ])\n  -\u003ecreate()\n;\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-forge%2Fical","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxp-forge%2Fical","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-forge%2Fical/lists"}