aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/examples/calendarserver.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-05-29 10:58:11 +0200
committerMario Vavti <mario@mariovavti.com>2016-05-29 10:58:11 +0200
commitcac6cef4952e6535788c1c6db8ef1e58e88536a0 (patch)
tree574d653201c280cb082877f80d814b6899aacaf9 /vendor/examples/calendarserver.php
parentaab9766c53e42c3141d0497fce78977d262efbc1 (diff)
downloadvolse-hubzilla-cac6cef4952e6535788c1c6db8ef1e58e88536a0.tar.gz
volse-hubzilla-cac6cef4952e6535788c1c6db8ef1e58e88536a0.tar.bz2
volse-hubzilla-cac6cef4952e6535788c1c6db8ef1e58e88536a0.zip
use composer to install sabre32
Diffstat (limited to 'vendor/examples/calendarserver.php')
-rw-r--r--vendor/examples/calendarserver.php76
1 files changed, 0 insertions, 76 deletions
diff --git a/vendor/examples/calendarserver.php b/vendor/examples/calendarserver.php
deleted file mode 100644
index e5f9f3387..000000000
--- a/vendor/examples/calendarserver.php
+++ /dev/null
@@ -1,76 +0,0 @@
-<?php
-
-/*
-
-CalendarServer example
-
-This server features CalDAV support
-
-*/
-
-// settings
-date_default_timezone_set('Canada/Eastern');
-
-// If you want to run the SabreDAV server in a custom location (using mod_rewrite for instance)
-// You can override the baseUri here.
-// $baseUri = '/';
-
-/* Database */
-$pdo = new PDO('sqlite:data/db.sqlite');
-$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
-
-//Mapping PHP errors to exceptions
-function exception_error_handler($errno, $errstr, $errfile, $errline) {
- throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
-}
-set_error_handler("exception_error_handler");
-
-// Files we need
-require_once 'vendor/autoload.php';
-
-// Backends
-$authBackend = new Sabre\DAV\Auth\Backend\PDO($pdo);
-$calendarBackend = new Sabre\CalDAV\Backend\PDO($pdo);
-$principalBackend = new Sabre\DAVACL\PrincipalBackend\PDO($pdo);
-
-// Directory structure
-$tree = [
- new Sabre\CalDAV\Principal\Collection($principalBackend),
- new Sabre\CalDAV\CalendarRoot($principalBackend, $calendarBackend),
-];
-
-$server = new Sabre\DAV\Server($tree);
-
-if (isset($baseUri))
- $server->setBaseUri($baseUri);
-
-/* Server Plugins */
-$authPlugin = new Sabre\DAV\Auth\Plugin($authBackend);
-$server->addPlugin($authPlugin);
-
-$aclPlugin = new Sabre\DAVACL\Plugin();
-$server->addPlugin($aclPlugin);
-
-/* CalDAV support */
-$caldavPlugin = new Sabre\CalDAV\Plugin();
-$server->addPlugin($caldavPlugin);
-
-/* Calendar subscription support */
-$server->addPlugin(
- new Sabre\CalDAV\Subscriptions\Plugin()
-);
-
-/* Calendar scheduling support */
-$server->addPlugin(
- new Sabre\CalDAV\Schedule\Plugin()
-);
-
-/* WebDAV-Sync plugin */
-$server->addPlugin(new Sabre\DAV\Sync\Plugin());
-
-// Support for html frontend
-$browser = new Sabre\DAV\Browser\Plugin();
-$server->addPlugin($browser);
-
-// And off we go!
-$server->exec();