當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Server::calculateUri方法代碼示例

本文整理匯總了PHP中Sabre\DAV\Server::calculateUri方法的典型用法代碼示例。如果您正苦於以下問題:PHP Server::calculateUri方法的具體用法?PHP Server::calculateUri怎麽用?PHP Server::calculateUri使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Sabre\DAV\Server的用法示例。


在下文中一共展示了Server::calculateUri方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: calculateUri

 public function calculateUri($uri)
 {
     $uri = parent::calculateUri($uri);
     if (!empty($this->uniqueBaseFile) && '/' . $uri !== $this->uniqueBaseFile) {
         $uri .= $this->uniqueBaseFile;
     }
     return $uri;
 }
開發者ID:Nanomani,項目名稱:pydio-core,代碼行數:8,代碼來源:Server.php

示例2: calendarMultiGetReport

 /**
  * This function handles the calendar-multiget REPORT.
  *
  * This report is used by the client to fetch the content of a series
  * of urls. Effectively avoiding a lot of redundant requests.
  *
  * @param \DOMNode $dom
  * @return void
  */
 function calendarMultiGetReport($dom)
 {
     $properties = array_keys(DAV\XMLUtil::parseProperties($dom->firstChild));
     $hrefElems = $dom->getElementsByTagNameNS('urn:DAV', 'href');
     $xpath = new \DOMXPath($dom);
     $xpath->registerNameSpace('cal', Plugin::NS_CALDAV);
     $xpath->registerNameSpace('dav', 'urn:DAV');
     $expand = $xpath->query('/cal:calendar-multiget/dav:prop/cal:calendar-data/cal:expand');
     if ($expand->length > 0) {
         $expandElem = $expand->item(0);
         $start = $expandElem->getAttribute('start');
         $end = $expandElem->getAttribute('end');
         if (!$start || !$end) {
             throw new DAV\Exception\BadRequest('The "start" and "end" attributes are required for the CALDAV:expand element');
         }
         $start = VObject\DateTimeParser::parseDateTime($start);
         $end = VObject\DateTimeParser::parseDateTime($end);
         if ($end <= $start) {
             throw new DAV\Exception\BadRequest('The end-date must be larger than the start-date in the expand element.');
         }
         $expand = true;
     } else {
         $expand = false;
     }
     $needsJson = $xpath->evaluate("boolean(/cal:calendar-multiget/dav:prop/cal:calendar-data[@content-type='application/calendar+json'])");
     $uris = [];
     foreach ($hrefElems as $elem) {
         $uris[] = $this->server->calculateUri($elem->nodeValue);
     }
     foreach ($this->server->getPropertiesForMultiplePaths($uris, $properties) as $uri => $objProps) {
         if (($needsJson || $expand) && isset($objProps[200]['{' . self::NS_CALDAV . '}calendar-data'])) {
             $vObject = VObject\Reader::read($objProps[200]['{' . self::NS_CALDAV . '}calendar-data']);
             if ($expand) {
                 $vObject->expand($start, $end);
             }
             if ($needsJson) {
                 $objProps[200]['{' . self::NS_CALDAV . '}calendar-data'] = json_encode($vObject->jsonSerialize());
             } else {
                 $objProps[200]['{' . self::NS_CALDAV . '}calendar-data'] = $vObject->serialize();
             }
         }
         $propertyList[] = $objProps;
     }
     $prefer = $this->server->getHTTPPRefer();
     $this->server->httpResponse->setStatus(207);
     $this->server->httpResponse->setHeader('Content-Type', 'application/xml; charset=utf-8');
     $this->server->httpResponse->setHeader('Vary', 'Brief,Prefer');
     $this->server->httpResponse->setBody($this->server->generateMultiStatus($propertyList, $prefer['return-minimal']));
 }
開發者ID:mattes,項目名稱:sabre-dav,代碼行數:58,代碼來源:Plugin.php


注:本文中的Sabre\DAV\Server::calculateUri方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。