本文整理汇总了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'));
}
}
}