MCPSERV.CLUB
SabreDAV

SabreDAV

Self-Hosted

PHP framework for WebDAV, CalDAV, and CardDAV servers

Active(87)
1.6kstars
0views
Updated 23 days ago

Overview

Discover what makes SabreDAV powerful

SabreDAV is a mature PHP framework that abstracts the implementation of WebDAV, CalDAV, and CardDAV servers. From a developer’s standpoint it functions as an extensible middleware layer that translates HTTP/WebDAV requests into domain‑specific operations on calendars and contacts. The framework exposes a clean object‑oriented API that lets you plug in custom backends, authentication strategies, and caching layers while still adhering to the RFCs for CalDAV (RFC 4791) and CardDAV (RFC 6350). By handling the low‑level request parsing, XML serialization, and protocol compliance internally, SabreDAV allows developers to focus on business logic rather than the intricacies of calendar and address book protocols.

Language & Runtime

Core Framework

Backends

Database

Overview

SabreDAV is a mature PHP framework that abstracts the implementation of WebDAV, CalDAV, and CardDAV servers. From a developer’s standpoint it functions as an extensible middleware layer that translates HTTP/WebDAV requests into domain‑specific operations on calendars and contacts. The framework exposes a clean object‑oriented API that lets you plug in custom backends, authentication strategies, and caching layers while still adhering to the RFCs for CalDAV (RFC 4791) and CardDAV (RFC 6350). By handling the low‑level request parsing, XML serialization, and protocol compliance internally, SabreDAV allows developers to focus on business logic rather than the intricacies of calendar and address book protocols.

Architecture

  • Language & Runtime: PHP 7.4+ (8.x supported), ensuring compatibility with modern LTS distributions.
  • Core Framework: The sabre/dav package is a set of PSR‑4 autoloaded classes that implement the WebDAV, CalDAV, and CardDAV specifications. It follows SOLID principles, with a clear separation between the protocol layer (Sabre\DAV) and backend abstractions (Sabre\DAV\Auth, Sabre\DAVACL).
  • Backends: The framework ships with several ready‑made backends (PDO, Doctrine DBAL, in‑memory). Developers can implement the Sabre\DAV\Tree interface to persist data in custom storage systems such as Redis, MongoDB, or even a graph database.
  • Database: No single database is required; the framework can operate with any PDO‑compatible database. The bundled SQLite backend is useful for quick prototypes, while production deployments typically use MySQL/MariaDB or PostgreSQL.
  • HTTP Layer: SabreDAV is designed to run behind any PHP SAPI (Apache, Nginx via FPM, FastCGI). It expects to be mounted at a URL prefix and uses Sabre\DAV\Request/Response objects to encapsulate the HTTP exchange.

Core Capabilities

  • CalDAV/CardDAV Support: Full CRUD operations on calendars, events (VEVENT), tasks (VTODO), and contacts (VCARD). Supports recurring rules, alarms, and iCalendar properties.
  • WebDAV Features: Properties, locking, versioning (via Sabre\DAV\Locks), and file operations (PROPFIND, PROPPATCH, MOVE, COPY).
  • Authentication & Authorization: Pluggable auth backends (Basic, Digest, OAuth2) and ACL support (Sabre\DAVACL) that maps WebDAV principals to application users.
  • Plugins: A modular plugin system lets developers add features such as logging, quota enforcement, or custom property handling without modifying core code.
  • API Exposure: All server logic is exposed through PHP objects, enabling integration into frameworks like Laravel or Symfony. Developers can expose a subset of functionality via REST endpoints that internally delegate to SabreDAV’s API.

Deployment & Infrastructure

  • Self‑Hosting: Since it is pure PHP, SabreDAV can be deployed on any LAMP/LEMP stack. It requires a writable directory for temporary files and optional storage for lock files.
  • Scalability: Statelessness of the HTTP layer allows horizontal scaling behind a load balancer. Persistent data is stored in external databases, so adding read replicas or sharding is straightforward.
  • Containerization: Official Docker images are available, simplifying CI/CD pipelines. The image is lightweight (based on php:8-fpm-alpine) and can be extended with custom PHP extensions or Composer dependencies.
  • Performance: Benchmarks show sub‑millisecond response times for simple property queries and < 5 ms for calendar CRUD operations on a MySQL backend, making it suitable for high‑traffic intranets.

Integration & Extensibility

  • Plugin System: Developers can write custom Sabre\DAV\ServerPlugin classes to hook into request/response cycles. Common use cases include rate limiting, custom logging, or injecting X‑headers for downstream services.
  • Webhooks & Events: The framework emits events (Sabre\DAV\Event) that can be listened to via a PSR‑14 event dispatcher, enabling real‑time synchronization with external services (e.g., pushing calendar updates to a mobile app).
  • Custom Principals: The Sabre\DAVACL component allows mapping of WebDAV principals to LDAP or OAuth users, facilitating single‑sign‑on scenarios.
  • Extending Storage: Implementing Sabre\DAV\Backend\Directory or Sabre\DAV\Backend\Calendar lets developers persist data in NoSQL stores, making the framework adaptable to diverse infrastructure.

Developer Experience

  • Documentation: The official site hosts comprehensive guides, API references, and example projects. Inline PHPDoc comments aid IDE autocompletion.
  • Community & Support: Active GitHub repository with frequent releases (master branch is current). Commercial support from fruux is available for enterprises.
  • Testing: The codebase includes extensive PHPUnit tests and CI pipelines, ensuring stability when integrating into larger applications.
  • Configuration: Most settings are controlled via PHP arrays, making it easy to embed SabreDAV in frameworks that use service containers.

Use Cases

  • Enterprise Calendar/Contact Server: Replace proprietary solutions with an open‑source CalDAV/CardDAV backend that integrates with Outlook, Apple Calendar, and Android.
  • Internal File Sync: Use WebDAV for

Open SourceReady to get started?

Join the community and start self-hosting SabreDAV today