本文整理汇总了PHP中Zend_Uri::getPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Uri::getPath方法的具体用法?PHP Zend_Uri::getPath怎么用?PHP Zend_Uri::getPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Uri
的用法示例。
在下文中一共展示了Zend_Uri::getPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toRefererUrl
protected function toRefererUrl(Zend_Uri $uri)
{
if ($uri->getPort() == '80') {
return $uri->getScheme() . '://' . $uri->getHost() . $uri->getPath() . $uri->getQuery();
}
return (string) $uri;
}
示例2: testGetPathInRefUrl
/**
* Make sure we get the correct path when it's set a reference URL
*
* @dataProvider refUrlProvider
*/
public function testGetPathInRefUrl(Zend_Uri $uri)
{
$path = $uri->getPath();
if (substr($path, -1, 1) == '/') {
$path .= 'x';
}
$path = dirname($path);
if ($path == DIRECTORY_SEPARATOR) {
$path = '/';
}
$cookie = Zend_Http_Cookie::fromString('foo=bar', (string) $uri);
if (!$cookie instanceof Zend_Http_Cookie) {
$this->fail("Failed creating a cookie object with URL '{$uri}'");
}
$this->assertEquals($path, $cookie->getPath());
}
示例3: toUrl
/**
* ignore port and fragment
* for match siteinfo(wedata)'s url-regex
*
*/
private function toUrl(Zend_Uri $uri)
{
$port = $uri->getPort();
$port = ($port > 0 and $port != '80') ? ':' . $port : '';
return $uri->getScheme() . '://' . $uri->getHost() . $port . $uri->getPath() . $uri->getQuery();
}