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


PHP PropFind::get方法代码示例

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


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

示例1: propFindLate

 /**
  * This event is triggered when fetching properties.
  *
  * This event is scheduled late in the process, after most work for
  * propfind has been done.
  */
 function propFindLate(DAV\PropFind $propFind, DAV\INode $node)
 {
     // If the request was made using the SOGO connector, we must rewrite
     // the content-type property. By default SabreDAV will send back
     // text/x-vcard; charset=utf-8, but for SOGO we must strip that last
     // part.
     if (strpos($this->server->httpRequest->getHeader('User-Agent'), 'Thunderbird') === false) {
         return;
     }
     $contentType = $propFind->get('{DAV:}getcontenttype');
     list($part) = explode(';', $contentType);
     if ($part === 'text/x-vcard' || $part === 'text/vcard') {
         $propFind->set('{DAV:}getcontenttype', 'text/x-vcard');
     }
 }
开发者ID:samj1912,项目名称:repo,代码行数:21,代码来源:Plugin.php

示例2: propFindLate

 /**
  * This method is triggered *after* all properties have been retrieved.
  * This allows us to inject the correct resourcetype for calendars that
  * have been shared.
  *
  * @param DAV\PropFind $propFind
  * @param DAV\INode $node
  * @return void
  */
 function propFindLate(DAV\PropFind $propFind, DAV\INode $node)
 {
     if ($node instanceof IShareableCalendar) {
         if ($rt = $propFind->get('{DAV:}resourcetype')) {
             if (count($node->getShares()) > 0) {
                 $rt->add('{' . Plugin::NS_CALENDARSERVER . '}shared-owner');
             }
         }
         $propFind->handle('{' . Plugin::NS_CALENDARSERVER . '}allowed-sharing-modes', function () {
             return new Xml\Property\AllowedSharingModes(true, false);
         });
     }
 }
开发者ID:pageer,项目名称:sabre-dav,代码行数:22,代码来源:SharingPlugin.php

示例3: propFindLate

 /**
  * This method is called when properties are retrieved.
  *
  * This specific handler is called very late in the process, because we
  * want other systems to first have a chance to handle the properties.
  *
  * @param PropFind $propFind
  * @param INode $node
  * @return void
  */
 function propFindLate(PropFind $propFind, INode $node)
 {
     $propFind->handle('{http://calendarserver.org/ns/}getctag', function () use($propFind) {
         // If we already have a sync-token from the current propFind
         // request, we can re-use that.
         $val = $propFind->get('{http://sabredav.org/ns}sync-token');
         if ($val) {
             return $val;
         }
         $val = $propFind->get('{DAV:}sync-token');
         if ($val && is_scalar($val)) {
             return $val;
         }
         if ($val && $val instanceof Property\IHref) {
             return substr($val->getHref(), strlen(Sync\Plugin::SYNCTOKEN_PREFIX));
         }
         // If we got here, the earlier two properties may simply not have
         // been part of the earlier request. We're going to fetch them.
         $result = $this->server->getProperties($propFind->getPath(), ['{http://sabredav.org/ns}sync-token', '{DAV:}sync-token']);
         if (isset($result['{http://sabredav.org/ns}sync-token'])) {
             return $result['{http://sabredav.org/ns}sync-token'];
         }
         if (isset($result['{DAV:}sync-token'])) {
             $val = $result['{DAV:}sync-token'];
             if (is_scalar($val)) {
                 return $val;
             } elseif ($val instanceof Property\IHref) {
                 return substr($val->getHref(), strlen(Sync\Plugin::SYNCTOKEN_PREFIX));
             }
         }
     });
 }
开发者ID:enoch85,项目名称:owncloud-testserver,代码行数:42,代码来源:CorePlugin.php

示例4: propFindLate

 /**
  * This method is triggered *after* all properties have been retrieved.
  * This allows us to inject the correct resourcetype for calendars that
  * have been shared.
  *
  * @param DAV\PropFind $propFind
  * @param DAV\INode $node
  * @return void
  */
 function propFindLate(DAV\PropFind $propFind, DAV\INode $node)
 {
     if ($node instanceof ISharedCalendar) {
         $shareAccess = $node->getShareAccess();
         if ($rt = $propFind->get('{DAV:}resourcetype')) {
             switch ($shareAccess) {
                 case \Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER:
                     $rt->add('{' . Plugin::NS_CALENDARSERVER . '}shared-owner');
                     break;
                 case \Sabre\DAV\Sharing\Plugin::ACCESS_READ:
                 case \Sabre\DAV\Sharing\Plugin::ACCESS_READWRITE:
                     $rt->add('{' . Plugin::NS_CALENDARSERVER . '}shared');
                     break;
             }
         }
         $propFind->handle('{' . Plugin::NS_CALENDARSERVER . '}allowed-sharing-modes', function () {
             return new Xml\Property\AllowedSharingModes(true, false);
         });
     }
 }
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:29,代码来源:SharingPlugin.php


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