本文整理汇总了PHP中Sabre_DAV_Server::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Sabre_DAV_Server::__construct方法的具体用法?PHP Sabre_DAV_Server::__construct怎么用?PHP Sabre_DAV_Server::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sabre_DAV_Server
的用法示例。
在下文中一共展示了Sabre_DAV_Server::__construct方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Sets up the object. A PDO object must be passed to setup all the backends.
*
* @param PDO $pdo
*/
public function __construct(PDO $pdo)
{
/* 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 = array(new Sabre_CalDAV_Principal_Collection($principalBackend), new Sabre_CalDAV_CalendarRootNode($principalBackend, $calendarBackend));
/* Initializing server */
parent::__construct($tree);
/* Server Plugins */
$authPlugin = new Sabre_DAV_Auth_Plugin($authBackend, $this->authRealm);
$this->addPlugin($authPlugin);
$aclPlugin = new Sabre_DAVACL_Plugin();
$this->addPlugin($aclPlugin);
$caldavPlugin = new Sabre_CalDAV_Plugin();
$this->addPlugin($caldavPlugin);
}
示例2: __construct
/**
* Sets up the object. A PDO object must be passed to setup all the backends.
*
* @param PDO $pdo
*/
public function __construct(PDO $pdo)
{
/* Backends */
$authBackend = new Sabre_DAV_Auth_Backend_PDO($pdo);
$calendarBackend = new Sabre_CalDAV_Backend_PDO($pdo);
/* Directory structure */
$root = new Sabre_DAV_SimpleDirectory('root');
$principals = new Sabre_DAV_Auth_PrincipalCollection($authBackend);
$root->addChild($principals);
$calendars = new Sabre_CalDAV_CalendarRootNode($authBackend, $calendarBackend);
$root->addChild($calendars);
$objectTree = new Sabre_DAV_ObjectTree($root);
/* Initializing server */
parent::__construct($objectTree);
/* Server Plugins */
$authPlugin = new Sabre_DAV_Auth_Plugin($authBackend, 'SabreDAV');
$this->addPlugin($authPlugin);
$caldavPlugin = new Sabre_CalDAV_Plugin();
$this->addPlugin($caldavPlugin);
}