sabre/dav

BSD-3-Clause
Platform
Linux Windows macOS
Licence
BSD-3-Clause Open source
Website
sabre.io
sabre/dav

sabre/dav is the WebDAV framework for PHP: a library you install with Composer when you need to build a WebDAV, CalDAV or CardDAV server instead of hand-rolling one. It owns the protocol work – the HTTP verbs, the XML request and response bodies, property storage, locking and sync tokens – and leaves the data model and business rules to your application. It has been maintained by fruux since 2007 and is the reference PHP implementation of these protocols: Nextcloud’s calendar and contacts daemons, Baikal and a long list of CalDAV servers trace back to it.

What it provides

  • WebDAV – classes 1, 2 and 3, including locking and the PROPFIND / PROPPATCH property model that clients from Finder and Windows Explorer to rclone expect.
  • CalDAV and CardDAV – the calendar-access and address-book protocols, so Thunderbird, DAVx5 and the iOS and macOS built-in calendar and contacts apps can talk to a server you built.
  • Sync – WebDAV sync (RFC 6578) sync tokens and partial updates, which is what keeps a mobile client’s first and later syncs cheap.
  • Access control and locking – an ACL plugin with principals and privilege sets, plus file locks and their PDO storage backends.
  • Authentication backends – HTTP Basic, Digest, PDO/SQL, LDAP and a custom backend interface, so credentials can come from wherever the application keeps them.
  • Browser plugin – a small HTML interface for walking the tree and inspecting properties while developing, rather than decoding raw XML replies.
  • Data formats – iCalendar and vCard parsing and validation through sabre/vobject, and HTTP plumbing through sabre/http and sabre/event.
  • Frameworks – the package composes with any PHP application; the repository ships runnable example servers (a file server, a calendar server, an address-book server) and the SQL schemas for SQLite, MySQL and PostgreSQL.

Requirements and installation

Composer only: composer require sabre/dav pulls the library and its three sibling packages, with no extensions beyond the ones PHP ships by default (dom, mbstring, simplexml, ctype, iconv, json, pcre, spl) and libxml 2.7 or newer. PHP 7.4 and every 8.x release are supported; the maintained branches are master and 4.x, while the 3.x line is unmaintained. Of the three storage backends, SQLite is the quickest to start with and the examples create the schema for you; a production server would normally use MySQL or PostgreSQL and put TLS in front of it, because clients refuse to send credentials over plain HTTP.

There is no binary, no admin panel and no release artefact to download: sabre/dav is code you wire into a PHP application, and the server you end up with is only as good as the storage backend you write against it. That is the trade – full control over the data model and no opinionated UI, in exchange for writing the application around it. Full documentation, including the protocol guides and the plugin catalogue, lives at sabre.io.

Where it fits

Most people meet sabre/dav indirectly. Radicale and Baikal are ready-made CalDAV and CardDAV servers you install and run; sabre/dav is what you reach for when you want a DAV server inside something else – a project tracker that exposes deadlines over CalDAV, a photo library that speaks WebDAV, an application that has to serve contacts to a phone. Nextcloud bundles a fork of it as the backbone of its calendar and contacts apps, and Calino is one of the clients that would consume a sabre/dav server. If the goal is a hosted calendar rather than DAV plumbing, one of those servers is the shorter path.

Explore More Categories

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.