armetiz/simple-ics

一个用于生成简单 ICS 文件的 PHP 7.1+ 库。

dev-master / 1.x-dev 2018-05-22 07:53 UTC

This package is not auto-updated.

Last update: 2022-01-08 15:27:09 UTC


README

创建一个非常简单的 ICS 事件。

允许的参数

  • 摘要
  • 描述
  • 位置
  • 开始日期
  • 结束日期
  • 组织者姓名及邮箱
  • 参与者姓名及邮箱
  • 警报

使用方法

<?php

use Armetiz\SimpleICS\ICSEvent;

$icsEvent = new ICSEvent([
    'startAt' => new DateTimeImmutable('+3 days'),
    'endAt' => new DateTimeImmutable('+5 days'),
    'summary' => 'Work session - Thomas Tourlourat',
    'description' => 'First time work session; will be awesome!',
    'location' => 'Lyon, France',
    'organizer' => [
        'email' => 'thomas@tourlourat.com',
        'name' => 'Thomas Tourlourat',
    ],
    'attendees' => [
        'thomastourlourat@gmail.com' => 'Thomas Tourlourat',
    ],
    'alarms' => [],
], 'wozbe.com');

file_put_contents('/tmp/work-session.ics', $icsEvent->output());