当前位置: 首页>>代码示例>>PHP>>正文


PHP Server::__construct方法代码示例

本文整理汇总了PHP中Sabre\DAV\Server::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Server::__construct方法的具体用法?PHP Server::__construct怎么用?PHP Server::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sabre\DAV\Server的用法示例。


在下文中一共展示了Server::__construct方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * @see \Sabre\DAV\Server
  */
 public function __construct($treeOrNode = null)
 {
     parent::__construct($treeOrNode);
     self::$exposeVersion = false;
     $this->enablePropfindDepthInfinity = true;
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:9,代码来源:Server.php

示例2: __construct

 public function __construct()
 {
     $this->rootCollection = new \AJXP_Sabre_Collection("/", null, null);
     parent::__construct($this->rootCollection);
 }
开发者ID:Nanomani,项目名称:pydio-core,代码行数:5,代码来源:Server.php

示例3: __construct

 public function __construct($baseUri = '/')
 {
     $this->debugExceptions = false;
     self::$exposeVersion = false;
     $this->setBaseUri($baseUri);
     date_default_timezone_set('GMT');
     if (\CApi::GetPDO()) {
         /* Authentication Plugin */
         $this->addPlugin(new \Sabre\DAV\Auth\Plugin(Backends::Auth(), 'SabreDAV'));
         /* Logs Plugin */
         $this->addPlugin(new Logs\Plugin());
         /* DAV ACL Plugin */
         $aclPlugin = new \Sabre\DAVACL\Plugin();
         $aclPlugin->hideNodesFromListings = true;
         $aclPlugin->defaultUsernamePath = Constants::PRINCIPALS_PREFIX;
         $mAdminPrincipal = \CApi::GetConf('labs.dav.admin-principal', false);
         if ($mAdminPrincipal !== false) {
             $aclPlugin->adminPrincipals = array(Constants::PRINCIPALS_PREFIX . '/' . $mAdminPrincipal);
         }
         $this->addPlugin($aclPlugin);
         $bIsOwncloud = false;
         /* Directory tree */
         $aTree = array($bIsOwncloud ? new CardDAV\AddressBookRoot(Backends::Principal(), Backends::GetBackend('carddav-owncloud')) : new CardDAV\AddressBookRoot(Backends::Principal(), Backends::Carddav()), new CalDAV\CalendarRootNode(Backends::Principal(), Backends::Caldav()), new CardDAV\GAddressBooks('gab', Constants::GLOBAL_CONTACTS));
         $this->oApiCapaManager = \CApi::Manager('capability');
         /* Files folder */
         if ($this->oApiCapaManager->IsFilesSupported()) {
             $bErrorCreateDir = false;
             /* Public files folder */
             $publicDir = \CApi::DataPath() . Constants::FILESTORAGE_PATH_ROOT;
             if (!file_exists($publicDir)) {
                 if (!@mkdir($publicDir)) {
                     $bErrorCreateDir = true;
                 }
             }
             $publicDir .= Constants::FILESTORAGE_PATH_CORPORATE;
             if (!file_exists($publicDir)) {
                 if (!@mkdir($publicDir)) {
                     $bErrorCreateDir = true;
                 }
             }
             $personalDir = \CApi::DataPath() . Constants::FILESTORAGE_PATH_ROOT . Constants::FILESTORAGE_PATH_PERSONAL;
             if (!file_exists($personalDir)) {
                 if (!@mkdir($personalDir)) {
                     $bErrorCreateDir = true;
                 }
             }
             $sharedDir = \CApi::DataPath() . Constants::FILESTORAGE_PATH_ROOT . Constants::FILESTORAGE_PATH_SHARED;
             if (!file_exists($sharedDir)) {
                 if (!@mkdir($sharedDir)) {
                     $bErrorCreateDir = true;
                 }
             }
             if ($bErrorCreateDir) {
                 throw new \Sabre\DAV\Exception('Can\'t create directory in ' . \CApi::DataPath() . Constants::FILESTORAGE_PATH_ROOT, 500);
             }
             $aFilesTree = array(new FS\RootPersonal($personalDir), new FS\RootPublic($publicDir));
             if (\CApi::GetConf('labs.files-sharing', false)) {
                 array_push($aFilesTree, new FS\RootShared($sharedDir));
             }
             array_push($aTree, new \Sabre\DAV\SimpleCollection('files', $aFilesTree));
             $this->addPlugin(new FS\Plugin());
             // Automatically guess (some) contenttypes, based on extesion
             $this->addPlugin(new \Sabre\DAV\Browser\GuessContentType());
         }
         $oPrincipalColl = new \Sabre\DAVACL\PrincipalCollection(Backends::Principal());
         $oPrincipalColl->disableListing = true;
         array_push($aTree, $oPrincipalColl);
         /* Initializing server */
         parent::__construct($aTree);
         $this->httpResponse->setHeader("X-Server", Constants::DAV_SERVER_NAME);
         /* Reminders Plugin */
         $this->addPlugin(new Reminders\Plugin(Backends::Reminders()));
         /* Contacts Plugin */
         $this->addPlugin(new Contacts\Plugin());
         if ($this->oApiCapaManager->IsMobileSyncSupported()) {
             /* CalDAV Plugin */
             $this->addPlugin(new \Sabre\CalDAV\Plugin());
             /* CardDAV Plugin */
             $this->addPlugin(new \Sabre\CardDAV\Plugin());
             /* ICS Export Plugin */
             $this->addPlugin(new \Sabre\CalDAV\ICSExportPlugin());
             /* VCF Export Plugin */
             $this->addPlugin(new \Sabre\CardDAV\VCFExportPlugin());
         }
         /* Calendar Sharing Plugin */
         $this->addPlugin(new \Sabre\CalDAV\SharingPlugin());
         /* HTML Frontend Plugin */
         if (\CApi::GetConf('labs.dav.use-browser-plugin', false) !== false) {
             $this->addPlugin(new \Sabre\DAV\Browser\Plugin(false, false));
         }
         /* Locks Plugin */
         //			$this->addPlugin(new \Sabre\DAV\Locks\Plugin(new \Sabre\DAV\Locks\Backend\File(\CApi::DataPath() . '/locks.dat')));
         $this->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'), 90);
     }
 }
开发者ID:hallnewman,项目名称:webmail-lite,代码行数:95,代码来源:Server.php

示例4: __construct

 public function __construct($baseUri = '/')
 {
     $this->debugExceptions = true;
     self::$exposeVersion = false;
     $this->setBaseUri($baseUri);
     date_default_timezone_set('GMT');
     if (\CApi::GetPDO()) {
         /* Authentication Plugin */
         $this->addPlugin(new \Afterlogic\DAV\Auth\Plugin(Backend::Auth(), 'SabreDAV'));
         /* Logs Plugin */
         //			$this->addPlugin(new Logs\Plugin());
         /* DAV ACL Plugin */
         $aclPlugin = new \Sabre\DAVACL\Plugin();
         $aclPlugin->hideNodesFromListings = true;
         $aclPlugin->defaultUsernamePath = Constants::PRINCIPALS_PREFIX;
         $mAdminPrincipal = \CApi::GetConf('labs.dav.admin-principal', false);
         $aclPlugin->adminPrincipals = $mAdminPrincipal !== false ? array(Constants::PRINCIPALS_PREFIX . '/' . $mAdminPrincipal) : array();
         $this->addPlugin($aclPlugin);
         $bIsOwncloud = false;
         /* Directory tree */
         $aTree = array($bIsOwncloud ? new CardDAV\AddressBookRoot(Backend::Principal(), Backend::getBackend('carddav-owncloud')) : new CardDAV\AddressBookRoot(Backend::Principal(), Backend::Carddav()), new CalDAV\CalendarRoot(Backend::Principal(), Backend::Caldav()), new CardDAV\GAB\AddressBooks('gab', Constants::GLOBAL_CONTACTS));
         $this->oApiCapaManager = \CApi::GetSystemManager('capability');
         /* Files folder */
         if ($this->oApiCapaManager->isFilesSupported()) {
             array_push($aTree, new \Afterlogic\DAV\FS\FilesRoot());
             $this->addPlugin(new FS\Plugin());
             // Automatically guess (some) contenttypes, based on extesion
             $this->addPlugin(new \Sabre\DAV\Browser\GuessContentType());
         }
         $oPrincipalColl = new \Sabre\DAVACL\PrincipalCollection(Backend::Principal());
         //			$oPrincipalColl->disableListing = true;
         array_push($aTree, $oPrincipalColl);
         /* Initializing server */
         parent::__construct($aTree);
         $this->httpResponse->setHeader("X-Server", Constants::DAV_SERVER_NAME);
         /* Reminders Plugin */
         $this->addPlugin(new Reminders\Plugin(Backend::Reminders()));
         $this->addPlugin(new \Sabre\CalDAV\Schedule\Plugin());
         $this->addPlugin(new \Sabre\CalDAV\Schedule\IMipPlugin('test@local.host'));
         /* Contacts Plugin */
         $this->addPlugin(new Contacts\Plugin());
         //			if ($this->oApiCapaManager->isMobileSyncSupported()) {
         /* CalDAV Plugin */
         $this->addPlugin(new \Sabre\CalDAV\Plugin());
         /* CardDAV Plugin */
         $this->addPlugin(new \Sabre\CardDAV\Plugin());
         /* ICS Export Plugin */
         $this->addPlugin(new \Sabre\CalDAV\ICSExportPlugin());
         /* VCF Export Plugin */
         $this->addPlugin(new \Sabre\CardDAV\VCFExportPlugin());
         //			}
         /* Calendar Sharing Plugin */
         $this->addPlugin(new \Sabre\CalDAV\SharingPlugin());
         /* DAV Sync Plugin */
         $this->addPlugin(new \Sabre\DAV\Sync\Plugin());
         /* HTML Frontend Plugin */
         if (\CApi::GetConf('labs.dav.use-browser-plugin', false) !== false) {
             $this->addPlugin(new \Sabre\DAV\Browser\Plugin());
         }
         /* Locks Plugin */
         //			$this->addPlugin(new \Sabre\DAV\Locks\Plugin());
         $this->on('beforeGetProperties', array($this, 'beforeGetProperties'), 90);
     }
 }
开发者ID:afterlogic,项目名称:dav,代码行数:64,代码来源:Server.php


注:本文中的Sabre\DAV\Server::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。