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