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


PHP Sabre_DAV_URLUtil::decodePath方法代码示例

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


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

示例1: calculateUri

 /**
  * Calculates the uri for a request, making sure that the base uri is stripped out
  *
  * @param string $uri
  * @throws Sabre_DAV_Exception_Forbidden A permission denied exception is thrown whenever there was an attempt to supply a uri outside of the base uri
  * @return string
  */
 public function calculateUri($uri)
 {
     if ($uri[0] != '/' && strpos($uri, '://')) {
         $uri = parse_url($uri, PHP_URL_PATH);
     }
     $uri = str_replace('//', '/', $uri);
     if (strpos($uri, $this->getBaseUri()) === 0) {
         return trim(Sabre_DAV_URLUtil::decodePath(substr($uri, strlen($this->getBaseUri()))), '/');
         // A special case, if the baseUri was accessed without a trailing
         // slash, we'll accept it as well.
     } elseif ($uri . '/' === $this->getBaseUri()) {
         return '';
     } else {
         throw new Sabre_DAV_Exception_Forbidden('Requested uri (' . $uri . ') is out of base uri (' . $this->getBaseUri() . ')');
     }
 }
开发者ID:jaeindia,项目名称:ownCloud-Enhancements,代码行数:23,代码来源:Server.php

示例2: testDecodeAccentsWindows7

 /**
  * This testcase was sent by a bug reporter
  *
  * @depends testDecode
  */
 function testDecodeAccentsWindows7()
 {
     $str = '/webdav/%C3%A0fo%C3%B3';
     $newStr = Sabre_DAV_URLUtil::decodePath($str);
     $this->assertEquals(strtolower($str), Sabre_DAV_URLUtil::encodePath($newStr));
 }
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:11,代码来源:URLUtilTest.php

示例3: calculateUri

 /**
  * Calculates the uri for a request, making sure that the base uri is stripped out 
  * 
  * @param string $uri 
  * @throws Sabre_DAV_Exception_PermissionDenied A permission denied exception is thrown whenever there was an attempt to supply a uri outside of the base uri
  * @return string
  */
 public function calculateUri($uri)
 {
     if ($uri[0] != '/' && strpos($uri, '://')) {
         $uri = parse_url($uri, PHP_URL_PATH);
     }
     $uri = str_replace('//', '/', $uri);
     if (strpos($uri, $this->baseUri) === 0) {
         return trim(Sabre_DAV_URLUtil::decodePath(substr($uri, strlen($this->baseUri))), '/');
     } else {
         throw new Sabre_DAV_Exception_PermissionDenied('Requested uri (' . $uri . ') is out of base uri (' . $this->baseUri . ')');
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:19,代码来源:Server.php


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