]> git.mxchange.org Git - friendica-addons.git/blob - dav/SabreDAV/lib/Sabre/CalDAV/Server.php
Update function names
[friendica-addons.git] / dav / SabreDAV / lib / Sabre / CalDAV / Server.php
1 <?php
2
3 /**
4  * CalDAV server
5  *
6  * Deprecated! Warning: This class is now officially deprecated
7  *
8  * This script is a convenience script. It quickly sets up a WebDAV server
9  * with caldav and ACL support, and it creates the root 'principals' and
10  * 'calendars' collections.
11  *
12  * Note that if you plan to do anything moderately complex, you are advised to
13  * not subclass this server, but use Sabre_DAV_Server directly instead. This
14  * class is nothing more than an 'easy setup'.
15  *
16  * @package Sabre
17  * @subpackage CalDAV
18  * @deprecated Don't use this class anymore, it will be removed in version 1.7.
19  * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
20  * @author Evert Pot (http://www.rooftopsolutions.nl/) 
21  * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
22  */
23 class Sabre_CalDAV_Server extends Sabre_DAV_Server {
24
25     /**
26      * The authentication realm
27      *
28      * Note that if this changes, the hashes in the auth backend must also
29      * be recalculated.
30      *
31      * @var string
32      */
33     public $authRealm = 'SabreDAV';
34
35     /**
36      * Sets up the object. A PDO object must be passed to setup all the backends.
37      *
38      * @param PDO $pdo
39      */
40     public function __construct(PDO $pdo) {
41
42         /* Backends */
43         $authBackend = new Sabre_DAV_Auth_Backend_PDO($pdo);
44         $calendarBackend = new Sabre_CalDAV_Backend_PDO($pdo);
45         $principalBackend = new Sabre_DAVACL_PrincipalBackend_PDO($pdo);
46
47         /* Directory structure */
48         $tree = array(
49             new Sabre_CalDAV_Principal_Collection($principalBackend),
50             new Sabre_CalDAV_CalendarRootNode($principalBackend, $calendarBackend),
51         );
52
53         /* Initializing server */
54         parent::__construct($tree);
55
56         /* Server Plugins */
57         $authPlugin = new Sabre_DAV_Auth_Plugin($authBackend,$this->authRealm);
58         $this->addPlugin($authPlugin);
59
60         $aclPlugin = new Sabre_DAVACL_Plugin();
61         $this->addPlugin($aclPlugin);
62
63         $caldavPlugin = new Sabre_CalDAV_Plugin();
64         $this->addPlugin($caldavPlugin);
65
66     }
67
68 }