4
date_default_timezone_set('UTC');
7
// The SabreDAV autoloader in Vivid is broken, so add one that just loads
8
// arbitrary files from /usr/share/php.
9
spl_autoload_register(function($class_name) {
10
$file = "/usr/share/php/" . str_replace("\\", "/", $class_name) . ".php";
11
if (file_exists($file)) {
16
class DummyAuth extends \Sabre\DAV\Auth\Backend\AbstractBasic {
17
protected function validateUserPass($username, $password) {
22
// Make sure there is a directory in your current directory named 'public'. We will be exposing that directory to WebDAV
23
$rootNode = new \Sabre\DAV\FS\Directory($publicDir);
25
// The rootNode needs to be passed to the server object.
26
$server = new \Sabre\DAV\Server($rootNode);
28
$server->addPlugin(new \Sabre\DAV\Auth\Plugin(new DummyAuth(), "realm"));
29
$server->addPlugin(new \Sabre\DAV\Browser\GuessContentType());