Overview

Packages

  • None
  • Rpc

Classes

  • Horde_Rpc
  • Horde_Rpc_ActiveSync
  • Horde_Rpc_Exception
  • Horde_Rpc_Phpgw
  • Horde_Rpc_Soap
  • Horde_Rpc_Syncml
  • Horde_Rpc_Syncml_Wbxml
  • Horde_Rpc_Translation
  • Horde_Rpc_Webdav
  • Horde_Rpc_Webdav2
  • Horde_Rpc_Xmlrpc
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * Copyright 2010-2012 Horde LLC (http://www.horde.org/)
 4:  *
 5:  * See the enclosed file COPYING for license information (LGPL). If you
 6:  * did not receive this file, see http://www.horde.org/licenses/lgpl21.
 7:  *
 8:  * @author   Ben Klang <bklang@horde.org>
 9:  * @category Horde
10:  * @package  Rpc
11:  */
12: 
13: class Horde_Rpc_Webdav2 extends Horde_Rpc
14: {
15: 
16:     private $_server;
17: 
18:     public function __construct($request, $params = array())
19:     {
20:         // PHP messages destroy XML output -> switch them off
21:         ini_set('display_errors', 0);
22: 
23:         if (strstr($_SERVER['PATH_INFO'])) {
24: 
25:         }
26:         $this->_server = $this->_getCalDAVServer();
27: 
28:         parent::__construct($request, $params);
29:     }
30: 
31:     private function _getCalDAVServer()
32:     {
33:         /* Get Horde objects for backends */
34:         $auth = $GLOBALS['injector']->getInstance('Horde_Auth');
35:         $registry = $GLOBALS['injector']->getInstance('Horde_Registry');
36: 
37:         /* Backends */
38:         $authBackend = new Sabre_DAV_Auth_Backend_Horde($registry);
39:         $calendarBackend = new Sabre_CalDAV_Backend_Horde($auth);
40: 
41:         /* Directory structure */
42:         $root = new Sabre_DAV_SimpleDirectory('root');
43:         $principals = new Sabre_DAV_Auth_PrincipalCollection($authBackend);
44:         $root->addChild($principals);
45:         $calendars = new Sabre_CalDAV_CalendarRootNode($authBackend, $calendarBackend);
46:         $root->addChild($calendars);
47: 
48:         $objectTree = new Sabre_DAV_ObjectTree($root);
49: 
50:         /* Initializing server */
51:         Sabre_DAV_Server::__construct($objectTree);
52: 
53:         /* Server Plugins */
54:         $authPlugin = new Sabre_DAV_Auth_Plugin($authBackend, 'Horde DAV Server');
55:         $this->addPlugin($authPlugin);
56: 
57:         $caldavPlugin = new Sabre_CalDAV_Plugin();
58:         $this->addPlugin($caldavPlugin);
59:     }
60: }
API documentation generated by ApiGen