0

我目前正在尝试将 CalDav 日历集成到我的网站中。我正在使用“baikal”,它实际上工作正常,我已经能够通过 iphone、macbook 等访问我的日历。

我现在想做的是从 mysql 数据库中读取事件并将它们显示在我自己的日历中。到目前为止它工作得很好,我找到了一个可以解析这些存储所有日历数据的 Blob 的库。

我现在的问题是:如何搜索这个 blob?例如,我想显示日期 x 和 y 之间的所有事件,或显示摘要/标题中包含“音乐会”的所有事件。

我对此进行了一些研究,但我找不到任何东西,所以我想我问!

期待您的回复,并提前致谢!大卫

4

1 回答 1

0

Why dont you use CalDAV to access the calendar, instead of trying to directly hit the MySQL DB ? From what I understand, you don't even own the schema as it comes from the Baikal server (?...) so you are running the risk of having to redo the work if/when Baikal changes the way they store the data.

Another advantage is that you are guaranteed to get a more consistent result: for example, time range queries (from date x to date y) can be tricky so by using CalDAV queries, both CalDAV clients and your calendar are going to return the same set of events whereas by trying to implement something on your own, you will likely diverge from what the CalDAV server returns.

There are php CalDAV clients. See for example Is there any php CalDav client library?

See https://www.rfc-editor.org/rfc/rfc4791#section-7.8.1 for a timerange based CalDAV query.

于 2013-07-09T16:15:41.747 回答