Upgrading from SabreDAV 0.8 to 0.9

To make sure SabreDAV provides a solid framework for future plugins, such as ACL and CalDAV support, it was needed to make a few core changes.

I felt compelled to make sure that this happened before the 1.0 release, because I'm planning on not introducing any breaks in major versions.

This document describes these changes

Locking support is now provided by a plugin

Old code:

$lockManager = new Sabre_DAV_LockManager_FS();

$tree = new SomeTreeClass();
$tree->setLockManager($lockManager);

$server = new Sabre_DAV_Server($tree);
$server->exec();

New code:

$tree = new SomeTreeClass();

$server = new Sabre_DAV_Server($tree);

$lockBackend = new Sabre_DAV_Locks_Backend_FS();
$lockPlugin = new Sabre_DAV_Locks_Plugin();
$server->addPlugin($lockPlugin);

$server->exec();

Temporary File Filter is now a plugin

Old code:

$tree = new SomeTreeClass();
$filterTree = new Sabre_DAV_Tree_TemporaryFileFilter($tree);

$server = new Sabre_DAV_Server($filterTree);
$server->exec();

New code:

$tree = new SomeTreeClass();

$server = new Sabre_DAV_Server($tree);

$tempPlugin = new Sabre_DAV_TemporaryFileFilterPlugin();
$server->addPlugin($tempPlugin);

$server->exec();

Tree and ObjectTree classes got an overhaul

If you were just using Sabre_DAV_ObjectTree to construct your filesystem, you can skip this section.

Before the Tree and ObjectTree classes would contain methods such as:

All these methods have now been removed and will no longer be called. As an alternative you must now supply a getNodeForPath($path) method, which must return one of the following classes or objects subclassing or implementing these interfaces:

This was needed to facilitate future extensions, such as ACL support.

Additionally the Tree class does no longer have any locking support (see the previous sections). This means the following methods are also gone: