Google Calendar通过2种方式与php同步 [英] Google Calendar sync with php in 2 ways

查看:87
本文介绍了Google Calendar通过2种方式与php同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个使用Google Calendar API的php网站.可以与创建,更新和删除"配合使用:在登录后,PHP网站上的任何事件都会进入我的Google日历事件.

I am creating a php website that uses the Google Calendar API. It's working fine with Create, Update and Delete: any event from the PHP website goes into my Google Calendar events after login.

在我的网站上创建的活动是在Google日历中创建的.

Events created on my site are created in Google Calendar.

我现在想要的是:当我从测试页创建事件时,登录后它会进入Google日历,然后,如果我从Google日历中更新或删除该事件,则它应该自动更新或删除php网站事件.

What I want now that is: when I create an event from my test page it goes into Google Calendar after login, then if I update or delete that event from Google Calendar then it should automatically update or delete the php website event.

基本上:1路同步工作正常,但现在我要2路同步.

Basically: 1-way sync is working fine but now I want 2-way synchronization.

如果有人有什么想法然后与我分享,将不胜感激.

If anybody has any ideas then kindly share with me, it will be much appreciated.

推荐答案

Google日历(gCal)中没有应用程序挂钩,可让您在删除事件时触发操作.取而代之的是,您必须定期轮询gCal(这可能是每隔几分钟/小时的一项cron作业)并相应地更新日历,或者您从日历中执行操作的任何时候,如果X中有1英寸,则可能会完全重新同步.

There are no application hooks in Google Calendar (gCal) that allow you to trigger an action when an event is deleted. Instead you must either poll gCal at intervals (this could be a cron job every few minutes/hours) and update your calendar accordingly, or any time you perform an action from your calendar have a 1 in X possibly of a full re-sync.

这意味着您正在使用gCal作为确定的源,并将这些更改镜像回本地应用程序.

This implies that you are using the gCal as the definitive source, and mirroring those changes back to your local application.

这篇关于Google Calendar通过2种方式与php同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆