horde/icalendar 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

horde/icalendar

Composer 安装命令:

composer require horde/icalendar

包简介

iCalendar and vCard library

README 文档

README

horde/icalendar is a PHP library for parsing, manipulating, and writing iCalendar (RFC 5545) and vCard data. It provides both a low-level content-line parser and a typed object model with open enums, value wrappers, and component accessors.

Installation

composer require horde/icalendar

Requires PHP 8.1+.

Architecture

Layers

Layer Namespace Purpose
Parser/Writer Horde\Icalendar Content-line reader, streaming reader, writer
Components Horde\Icalendar\Component PropertyBag, AbstractComponent, ComponentFactory
Calendar types Horde\Icalendar\Calendar VCalendar, Vevent, Vtodo, Vjournal, Vfreebusy, Valarm, Vtimezone
Enums Horde\Icalendar\Enum Open enum classes (ParticipationStatus, CalendarMethod, EventStatus, etc.)
Values Horde\Icalendar\Value Attendee, Organizer, DateTimeParser

Boundaries

This library is responsible for:

  • Parsing iCalendar/vCard byte streams into an object model
  • Providing typed accessors for well known component properties (UID, DTSTART, ATTENDEE, etc.) and a generic bag for all parsed properties known and unknown.
  • Serializing the object model back to RFC-compliant text
  • Representing iCalendar values with correct semantics (open enums, date/time, attendee roles)

This library in its modern form is not responsible for:

  • iTIP scheduling logic (REQUEST/REPLY/CANCEL processing) — see horde/itip
  • Email transport (iMIP) will be handled by the upcoming horde/imip package
  • CalDAV operations are handled by horde/dav
  • Calendar and addressbook UI or storage. These are handled by application layers (Kronolith, Nag, Turba)

Collaboration Partners

Package Relationship
horde/timezone Timezone handling, formatting and matching beyond IANA standards based builtins, ready to handle real world quirks (Outlook/Exchange, Apple)
horde/date Recurrence calculations and date formatting
horde/itip Consumes VCalendar, Vevent, Vtodo, Attendee, Organizer, and open enums for iTIP scheduling decisions
horde/imip (planned) Will consume serialized VCalendar output for MIME email transport
horde/dav Uses the parser/writer for CalDAV object exchange
Kronolith / Nag / Turba Application layers that store and display calendar/task data

Upgrading

See doc/UPGRADING.md for migration guidance from Horde_Icalendar (PSR-0) to the modern Horde\Icalendar (PSR-4) API.

Usage

use Horde\Icalendar\Calendar\VCalendar;
use Horde\Icalendar\Calendar\Vevent;
use Horde\Icalendar\Enum\CalendarMethod;
use Horde\Icalendar\Enum\ParticipationStatus;
use Horde\Icalendar\Value\Attendee;
use Horde\Icalendar\Value\Organizer;
use Horde\Icalendar\Reader;

// Parse from string
$reader = new Reader();
$cal = $reader->readString($icsData);

// Typed access
$event = $cal->getEvents()[0];
$uid = $event->getUid();
$start = $event->getDtstart();
$attendees = $event->getAttendees();

foreach ($attendees as $attendee) {
    $email = $attendee->getEmail();
    $status = $attendee->getParticipationStatus(); // ParticipationStatus open enum
}

// Build programmatically
$event = new Vevent();
$event->setUid('unique-id@example.com');
$event->setSummary('Team Meeting');
$event->setDtstart(new DateTimeImmutable('2026-06-01 10:00'), 'America/New_York');
$event->setOrganizer(Organizer::create('boss@example.com', 'The Boss'));
$event->addAttendee(Attendee::create('dev@example.com', 'Developer', ParticipationStatus::from('NEEDS-ACTION')));

$cal = new VCalendar();
$cal->setVersion();
$cal->setMethod(CalendarMethod::from('REQUEST'));
$cal->addChild($event);

License

LGPL-2.1 — see LICENSE.

horde/icalendar 适用场景与选型建议

horde/icalendar 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.86k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2023 年 10 月 27 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 horde/icalendar 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 horde/icalendar 我们能提供哪些服务?
定制开发 / 二次开发

基于 horde/icalendar 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 3.86k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 7
  • 依赖项目数: 20
  • 推荐数: 3

GitHub 信息

  • Stars: 1
  • Watchers: 5
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-2.1-only
  • 更新时间: 2023-10-27