sabre-io / dav

sabre/dav is a CalDAV, CardDAV and WebDAV framework for PHP
http://sabre.io
BSD 3-Clause "New" or "Revised" License
1.52k stars 344 forks source link

Caldav & Laraval #1533

Closed PinterMilan closed 4 weeks ago

PinterMilan commented 8 months ago

Hi, I have a Laravel 9.* project with PHP 8.2, which functions as a calendar. I have already installed and configured the Caldav server, so it is working. When i create an event in Thunderbird cal, then that event is stored in db.

I would like to synchronize the Thunderbird calendar with my Laravel calendar. My plan is that when the Thunderbird client requests events from the Caldav server, the Caldav server will send the stored events from the SabreDAV database, including the events stored by my Laravel Calendar in another database (MySQL).

I plan to convert the details of the events stored in my Laravel calendar into iCalendar format and merge the two event lists together. This way, Thunderbird will receive all corresponding events.

My question is: where can I find the code that manages event handling? When a synchronization request for events comes in, which code snippet is responsible for querying the database and sending the events to the Thunderbird client? I believe I should edit that snippet to merge and send the events.

Furthermore, when a user creates an event in their Thunderbird Calendar, Caldav will store it in the database. Which code snippet is responsible for storing the events in the database?

Thanks for your help in advance.

DeepDiver1975 commented 4 weeks ago

Furthermore, when a user creates an event in their Thunderbird Calendar, Caldav will store it in the database. Which code snippet is responsible for storing the events in the database?

https://github.com/sabre-io/dav/blob/master/lib/CalDAV/Backend/PDO.php

DeepDiver1975 commented 4 weeks ago

My question is: where can I find the code that manages event handling? When a synchronization request for events comes in, which code snippet is responsible for querying the database and sending the events to the Thunderbird client? I believe I should edit that snippet to merge and send the events.

the logic is in the code base at https://github.com/sabre-io/dav/tree/master/lib/CalDAV

I suggest you attach a debugger and walk through the code to understand.

happy coding