vadgab/yii2-google-calendar-api
Composer 安装命令:
composer require vadgab/yii2-google-calendar-api
包简介
The application is a YII2-Extension for the Google Calendar API
关键字:
README 文档
README
Yii2 Google Calendar Api Extension
Installation
The preferred way to install this extension is through composer:
composer require --prefer-dist vadgab/yii2-google-calendar-api
Basic information
This application operates with Google Calendar Service Account-based authentication, meaning the login process happens in the background. It enables querying, creating, modifying, and deleting calendar-related events for third-party users without the need for authentication in a pop-up window.
Configuration
You will need to create a Service Account in the Google Cloud Console, to which you must grant the appropriate permissions to access the calendar, as well as a authentication key, which you download and place for the application to access, and provide the path to it.
Basic Usage
getEvents() - Get event, list
parameters
- Params (opcional) - full param list : https://developers.google.com/calendar/api/v3/reference/events/list
use vadgab\Yii2GoogleCalendar\GoogleCalendar; $serviceAccount = new GoogleCalendar( "your_service_email", "./../your_downloaded_key.json", array( "https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.events" ) ); $serviceAccount->calendarId = "calendarId"; //required $params = ['timeMin'=>'2020-06-03T10:00:00Z']; //opcional $serviceAccount->evenId = "eventId"; //opcional $events = $serviceAccount->getEvents($params); echo "<pre>"; var_dump($events); echo "</pre>";
insertEvent() - Add event on your calendar
parameters
- payload (require) - full param list : https://developers.google.com/calendar/api/v3/reference/events/insert
use vadgab\Yii2GoogleCalendar\GoogleCalendar; $serviceAccount = new GoogleCalendar( "your_service_email", "./../your_downloaded_key.json", array( "https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.events" ) ); $serviceAccount->calendarId = "calendarId"; //required $payload = array( 'summary' => 'Teszt Event', 'description' => 'Teszt description', 'location' => 'Budapest', 'start' => array('dateTime' => "2023-05-10T10:00:00Z"), 'end' => array('dateTime' => "2023-05-10T11:00:00Z"), ); $events = $serviceAccount->insertEvent($payload); echo "<pre>"; var_dump($events); echo "</pre>";
Response
array(18) { ["kind"]=> string(14) "calendar#event" ["etag"]=> string(18) """" ["id"]=> string(26) "tme6m9k9g4p0n6sr48693oq4fo" ["status"]=> string(9) "confirmed" ["htmlLink"]=> string(93) "https://www.google.com/calendar/event?eid=***" ["created"]=> string(24) "2023-05-05T11:17:57.000Z" ["updated"]=> string(24) "2023-05-05T11:17:57.483Z" ["summary"]=> string(11) "Teszt Event" ["description"]=> string(17) "Teszt description" ["location"]=> string(8) "Budapest" ["creator"]=> array(1) { ["email"]=> string(75) "**************************" } ["organizer"]=> array(2) { ["email"]=> string(19) "" ["self"]=> bool(true) } ["start"]=> array(2) { ["dateTime"]=> string(25) "2023-05-10T12:00:00+02:00" ["timeZone"]=> string(3) "UTC" } ["end"]=> array(2) { ["dateTime"]=> string(25) "2023-05-10T13:00:00+02:00" ["timeZone"]=> string(3) "UTC" } ["iCalUID"]=> string(37) "**************" ["sequence"]=> int(0) ["reminders"]=> array(1) { ["useDefault"]=> bool(true) } ["eventType"]=> string(7) "default" }
updateEvent() - Add event on your calendar
parameters
- payload (require) - full param list : https://developers.google.com/calendar/api/v3/reference/events/update
use vadgab\Yii2GoogleCalendar\GoogleCalendar; $serviceAccount = new GoogleCalendar( "your_service_email", "./../your_downloaded_key.json", array( "https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.events" ) ); $serviceAccount->calendarId = "calendarId"; //required $serviceAccount->eventId = "eventId"; //required $payload = array( 'summary' => 'Teszt Event update', 'description' => 'Teszt description update', 'location' => 'Budapest', 'start' => array('dateTime' => "2023-05-10T10:00:00Z"), 'end' => array('dateTime' => "2023-05-10T11:00:00Z"), ); $events = $serviceAccount->updateEvent($payload); echo "<pre>"; var_dump($events); echo "</pre>";
Response
array(18) { ["kind"]=> string(14) "calendar#event" ["etag"]=> string(18) """" ["id"]=> string(26) "tme6m9k9g4p0n6sr48693oq4fo" ["status"]=> string(9) "confirmed" ["htmlLink"]=> string(93) "https://www.google.com/calendar/event?eid=***" ["created"]=> string(24) "2023-05-05T11:17:57.000Z" ["updated"]=> string(24) "2023-05-05T11:17:57.483Z" ["summary"]=> string(11) "Teszt Event update" ["description"]=> string(17) "Teszt description update" ["location"]=> string(8) "Budapest" ["creator"]=> array(1) { ["email"]=> string(75) "**************************" } ["organizer"]=> array(2) { ["email"]=> string(19) "" ["self"]=> bool(true) } ["start"]=> array(2) { ["dateTime"]=> string(25) "2023-05-10T12:00:00+02:00" ["timeZone"]=> string(3) "UTC" } ["end"]=> array(2) { ["dateTime"]=> string(25) "2023-05-10T13:00:00+02:00" ["timeZone"]=> string(3) "UTC" } ["iCalUID"]=> string(37) "**************" ["sequence"]=> int(0) ["reminders"]=> array(1) { ["useDefault"]=> bool(true) } ["eventType"]=> string(7) "default" }
deleteEvent() - Delete event on your calendar
use vadgab\Yii2GoogleCalendar\GoogleCalendar; $serviceAccount = new GoogleCalendar( "your_service_email", "./../your_downloaded_key.json", array( "https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.events" ) ); $serviceAccount->calendarId = "calendarId"; //required $serviceAccount->eventId = "eventId"; //required $events = $serviceAccount->deleteEvent();
vadgab/yii2-google-calendar-api 适用场景与选型建议
vadgab/yii2-google-calendar-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 05 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「yii2」 「google-calendar」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 vadgab/yii2-google-calendar-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 vadgab/yii2-google-calendar-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 vadgab/yii2-google-calendar-api 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A custom URL rule class for Yii 2 which allows to create translated URL rules
A PSR-7 compatible library for making CRUD API endpoints
Package to work with the Google Calendar API
SCEditor, a lightweight WYSIWYG BBCode & HTML editor extension for Yii 2.0 Framework
Redirect all not authenticated web user to login page.
React javascript library for Yii2
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-05-02

