om/icalparser
最新稳定版本:v3.2.1
Composer 安装命令:
composer require om/icalparser
包简介
Simple iCal parser
关键字:
README 文档
README
PHP iCal Parser
Internet Calendaring Parser rfc2445 or iCal parser is simple PHP class for parsing format into array.
How to install
The recommended way to is via Composer:
composer require om/icalparser
Usage and example
<?php use om\IcalParser; require_once '../vendor/autoload.php'; $cal = new IcalParser(); $results = $cal->parseFile( 'https://www.google.com/calendar/ical/cs.czech%23holiday%40group.v.calendar.google.com/public/basic.ics' ); foreach ($cal->getEvents()->sorted() as $event) { printf('%s - %s' . PHP_EOL, $event['DTSTART']->format('j.n.Y'), $event['SUMMARY']); }
Each property of each event is available using the property name (in capital letters) as a key. There are some special cases:
- multiple attendees with individual parameters: use
ATTENDEESas key to get all attendees in the following scheme:
[ [ 'ROLE' => 'REQ-PARTICIPANT', 'PARTSTAT' => 'NEEDS-ACTION', 'CN' => 'John Doe', 'VALUE' => 'mailto:john.doe@example.org' ], [ 'ROLE' => 'REQ-PARTICIPANT', 'PARTSTAT' => 'NEEDS-ACTION', 'CN' => 'Test Example', 'VALUE' => 'mailto:test@example.org' ] ]
- organizer's name: the CN parameter of the organizer property can be retrieved using the key
ORGANIZER-CN
You can run example with PHP Built-in web server as follow:
php -S localhost:8000 -t example
Requirements
- PHP 8.1+
Run tests
iCal parser using Nette Tester. The tests can be invoked via composer.
composer update
composer test
统计信息
- 总下载量: 512.38k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 60
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2014-01-02