aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/examples/addressbookserver.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/dav/examples/addressbookserver.php')
-rw-r--r--vendor/sabre/dav/examples/addressbookserver.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/vendor/sabre/dav/examples/addressbookserver.php b/vendor/sabre/dav/examples/addressbookserver.php
index b8986bc41..6d1c9b26c 100644
--- a/vendor/sabre/dav/examples/addressbookserver.php
+++ b/vendor/sabre/dav/examples/addressbookserver.php
@@ -17,10 +17,10 @@ $baseUri = '/';
/* Database */
$pdo = new PDO('sqlite:data/db.sqlite');
-$pdo->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
+$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
//Mapping PHP errors to exceptions
-function exception_error_handler($errno, $errstr, $errfile, $errline ) {
+function exception_error_handler($errno, $errstr, $errfile, $errline) {
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
set_error_handler("exception_error_handler");
@@ -35,22 +35,23 @@ $carddavBackend = new Sabre\CardDAV\Backend\PDO($pdo);
//$caldavBackend = new Sabre\CalDAV\Backend\PDO($pdo);
// Setting up the directory tree //
-$nodes = array(
+$nodes = [
new Sabre\DAVACL\PrincipalCollection($principalBackend),
-// new Sabre\CalDAV\CalendarRootNode($authBackend, $caldavBackend),
+// new Sabre\CalDAV\CalendarRoot($authBackend, $caldavBackend),
new Sabre\CardDAV\AddressBookRoot($principalBackend, $carddavBackend),
-);
+];
// The object tree needs in turn to be passed to the server class
$server = new Sabre\DAV\Server($nodes);
$server->setBaseUri($baseUri);
// Plugins
-$server->addPlugin(new Sabre\DAV\Auth\Plugin($authBackend,'SabreDAV'));
+$server->addPlugin(new Sabre\DAV\Auth\Plugin($authBackend));
$server->addPlugin(new Sabre\DAV\Browser\Plugin());
//$server->addPlugin(new Sabre\CalDAV\Plugin());
$server->addPlugin(new Sabre\CardDAV\Plugin());
$server->addPlugin(new Sabre\DAVACL\Plugin());
+$server->addPlugin(new Sabre\DAV\Sync\Plugin());
// And off we go!
$server->exec();