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


PHP Sabre_DAV_Server::getHeader方法代码示例

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


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

示例1: afterGetProperties

 /**
  * afterGetProperties
  *
  * This method handler is invoked after properties for a specific resource
  * are received. This allows us to add any properties that might have been
  * missing.
  * 
  * @param string $path
  * @param array $properties 
  * @return void
  */
 public function afterGetProperties($path, &$properties)
 {
     // Find out if we are currently looking at a principal resource
     $currentNode = $this->server->tree->getNodeForPath($path);
     if ($currentNode instanceof Sabre_DAV_Auth_Principal) {
         // calendar-home-set property
         $calHome = '{' . self::NS_CALDAV . '}calendar-home-set';
         if (array_key_exists($calHome, $properties[404])) {
             $principalId = $currentNode->getName();
             $calendarHomePath = self::CALENDAR_ROOT . '/' . $principalId . '/';
             unset($properties[404][$calHome]);
             $properties[200][$calHome] = new Sabre_DAV_Property_Href($calendarHomePath);
         }
         // calendar-user-address-set property
         $calProp = '{' . self::NS_CALDAV . '}calendar-user-address-set';
         if (array_key_exists($calProp, $properties[404])) {
             // Do we have an email address?
             $props = $currentNode->getProperties(array('{http://sabredav.org/ns}email-address'));
             if (isset($props['{http://sabredav.org/ns}email-address'])) {
                 $email = $props['{http://sabredav.org/ns}email-address'];
             } else {
                 // We're going to make up an emailaddress
                 $email = $currentNode->getName() . '.sabredav@' . $this->server->getHeader('host');
             }
             $properties[200][$calProp] = new Sabre_DAV_Property_Href('mailto:' . $email, false);
             unset($properties[404][$calProp]);
         }
     }
     if ($currentNode instanceof Sabre_CalDAV_Calendar || $currentNode instanceof Sabre_CalDAV_CalendarObject) {
         if (array_key_exists('{DAV:}supported-report-set', $properties[200])) {
             $properties[200]['{DAV:}supported-report-set']->addReport(array('{' . self::NS_CALDAV . '}calendar-multiget', '{' . self::NS_CALDAV . '}calendar-query'));
         }
     }
 }
开发者ID:jtietema,项目名称:Fizzy,代码行数:45,代码来源:Plugin.php


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