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


PHP Sabre_HTTP_Request::getBody方法代码示例

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


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

示例1: testDefaultInputStream

 function testDefaultInputStream()
 {
     $h = fopen('php://memory', 'r+');
     fwrite($h, 'testing');
     rewind($h);
     $previousValue = Sabre_HTTP_Request::$defaultInputStream;
     Sabre_HTTP_Request::$defaultInputStream = $h;
     $this->assertEquals('testing', $this->request->getBody(true), 'We didn\'t get our testbody back');
     Sabre_HTTP_Request::$defaultInputStream = $previousValue;
 }
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:10,代码来源:RequestTest.php

示例2: httpReport

 /**
  * HTTP REPORT method implementation
  *
  * Although the REPORT method is not part of the standard WebDAV spec (it's from rfc3253)
  * It's used in a lot of extensions, so it made sense to implement it into the core.
  *
  * @param string $uri
  * @return void
  */
 protected function httpReport($uri)
 {
     $body = $this->httpRequest->getBody(true);
     $dom = Sabre_DAV_XMLUtil::loadDOMDocument($body);
     $reportName = Sabre_DAV_XMLUtil::toClarkNotation($dom->firstChild);
     if ($this->broadcastEvent('report', array($reportName, $dom, $uri))) {
         // If broadcastEvent returned true, it means the report was not supported
         throw new Sabre_DAV_Exception_ReportNotImplemented();
     }
 }
开发者ID:jaeindia,项目名称:ownCloud-Enhancements,代码行数:19,代码来源:Server.php

示例3: httpReport

 /**
  * HTTP REPORT method implementation
  *
  * Although the REPORT method is not part of the standard WebDAV spec (it's from rfc3253)
  * It's used in a lot of extensions, so it made sense to implement it into the core.
  * 
  * @return void
  */
 protected function httpReport()
 {
     $body = $this->httpRequest->getBody(true);
     //We'll need to change the DAV namespace declaration to something else in order to make it parsable
     $body = preg_replace("/xmlns(:[A-Za-z0-9_]*)?=(\"|\\')DAV:(\"|\\')/", "xmlns\\1=\"urn:DAV\"", $body);
     $errorsetting = libxml_use_internal_errors(true);
     libxml_clear_errors();
     $dom = new DOMDocument();
     $dom->loadXML($body);
     $dom->preserveWhiteSpace = false;
     $namespaceUri = $dom->firstChild->namespaceURI;
     if ($namespaceUri == 'urn:DAV') {
         $namespaceUri = 'DAV:';
     }
     $reportName = '{' . $namespaceUri . '}' . $dom->firstChild->localName;
     if ($this->broadcastEvent('report', array($reportName, $dom))) {
         // If broadcastEvent returned true, it means the report was not supported
         throw new Sabre_DAV_Exception_ReportNotImplemented();
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:28,代码来源:Server.php


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