fredbradley/socs-calendar-ics-parser
Composer 安装命令:
composer require fredbradley/socs-calendar-ics-parser
包简介
A PHP Script that parses an ICS file from SOCS, in a readable format to display elsewhere.
README 文档
README
A PHP Script that parses an ICS file from SOCS, in a readable format to display elsewhere.
Features
- Super easy to use.
- Once you've included it in your composer package, just one line of code will get you a PHP array of Event Objects.
- Compatible with Wordpress transients, if you use Wordpress.
- Compatible with Laravel Caching, if you use Laravel.
- Actively managed - if you have a feature or idea request, please let me know, or even better - submit a pull request.
Requirements
This project requires PHP 7. I'm too lazy to write for PHP5.6 these days. Get with the program!
How to install
composer install fredbradley/socs-calendar-ics-parser
Examples
Wordpress Widget Example
This is written to work with Wordpress and even has Wordpress Caching (set_transient) functionality built in, to speed up page load times.
If you want to see an example of a widget that uses this code, please see this piece of code in my 'cranleigh-socs' plugin. If you like you can install the entire Cranleigh SOCS Plugin, but be aware it's written in Bootstrap 3 with HTML markup specifically for our sites.
If you want some help customising it, I'd be happy to help.
Usage
Options
minNumEvents(default: 5)ignoreCache(default: false) Set totrueif you don't want get the object from the cache.cacheName(default: 'calendar-cache') if you have more than one instance of this, you should probably give each instance a unique cache name, so they don't overwrite each otherweeksAhead(default: 15) how many weeks ahead to you want to get the events for
Basic Example with Default Options
$ics_url = "<YOUR URL FOR YOUR ICS HERE>";
$calendar = new \FredBradley\SOCSICSParser\CalendarEvents( $ics_url );
Example with custom options
$ics_url = "<YOUR URL FOR YOUR ICS HERE>";
$options = [
'minNumEvents' => 10,
'cacheName' => 'my-music-calendar'
];
$calendar = new \FredBradley\SOCSICSParser\CalendarEvents( $ics_url, $options );
fredbradley/socs-calendar-ics-parser 适用场景与选型建议
fredbradley/socs-calendar-ics-parser 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.13k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2018 年 07 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 fredbradley/socs-calendar-ics-parser 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fredbradley/socs-calendar-ics-parser 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 4.13k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: AGPL-3.0-or-later
- 更新时间: 2018-07-20
