Question

I'm currently trying to integrate a CalDav Calendar into my website. I'm using "baikal" and it actually works fine, i'm already able to access my calendar via iphone, macbook and so on.

What I wanna do now is reading the Events from the mysql database and display them in my own calendar. It works fine so far, I found a library that can parse these Blobs which stores all calendardata.

My problem now is: How can I search through this blob? For example, i want to display all events between date x and y, or display all events that contain "concert" in the summary/title.

I did some research on this but i wasn't able to find anything so I thought I ask!

looking forward to your replies and thanks in advance! david

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top