sabre/dav
The most popular PHP framework for building WebDAV, CalDAV, and CardDAV servers.
Repository Health
Technical Analysis
sabre/dav is a mature PHP framework for building WebDAV, CalDAV, and CardDAV servers. It implements the low-level protocol machinery — request parsing, XML handling, property management, locking, and access control — so you can expose files, calendars, and contacts over standards-compliant endpoints that sync with clients like macOS Calendar, iOS Contacts, Thunderbird, and any WebDAV file manager. A plugin architecture lets you layer in authentication, ACLs, calendaring, and address books on top of a pluggable node and backend model.
What You Get
- A protocol-complete WebDAV server core with property handling, locking, and range requests
- CalDAV and CardDAV plugins for serving calendars and address books to standard clients
- Pluggable backends and authentication (PDO, ACL, basic/digest) plus a plugin system for custom behavior
Common Use Cases
- Running a self-hosted CalDAV/CardDAV server for calendar and contact sync across devices
- Exposing an application’s files over WebDAV so users can mount and edit them from the OS
- Building a groupware or collaboration backend that speaks the same protocols as Apple and Mozilla clients
Under The Hood
Architecture - The Sabre\DAV\Server sits at the center, dispatching HTTP methods against a tree of INode objects and firing events through a sabre/event emitter. Cross-cutting behavior — CalDAV, CardDAV, DAVACL, locking, and authentication — is delivered as plugins under lib/, each hooking the server’s events rather than subclassing it, which keeps the protocol core stable while features compose on top. Tech Stack - Requires PHP 7.4 or 8.x and a set of core extensions (dom, simplexml, mbstring, iconv, libxml) plus the sabre ecosystem: sabre/event, sabre/http, and sabre/vobject for iCalendar/vCard parsing. Code Quality - The repository carries an extensive PHPUnit test suite under tests/, PHPStan static analysis, and php-cs-fixer formatting, reflecting more than a decade of maintenance and a large, active contributor base. API Design - Servers are assembled by composing a node tree and registering plugins, a well-documented pattern on sabre.io; the abstraction is deep but the public surface for standing up a basic server is small.