本文整理汇总了PHP中Auth_Yadis_startswith函数的典型用法代码示例。如果您正苦于以下问题:PHP Auth_Yadis_startswith函数的具体用法?PHP Auth_Yadis_startswith怎么用?PHP Auth_Yadis_startswith使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Auth_Yadis_startswith函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Auth_OpenID_remove_dot_segments
function Auth_OpenID_remove_dot_segments($path)
{
$result_segments = array();
while ($path) {
if (Auth_Yadis_startswith($path, '../')) {
$path = substr($path, 3);
} else {
if (Auth_Yadis_startswith($path, './')) {
$path = substr($path, 2);
} else {
if (Auth_Yadis_startswith($path, '/./')) {
$path = substr($path, 2);
} else {
if ($path == '/.') {
$path = '/';
} else {
if (Auth_Yadis_startswith($path, '/../')) {
$path = substr($path, 3);
if ($result_segments) {
array_pop($result_segments);
}
} else {
if ($path == '/..') {
$path = '/';
if ($result_segments) {
array_pop($result_segments);
}
} else {
if ($path == '..' || $path == '.') {
$path = '';
} else {
$i = 0;
if ($path[0] == '/') {
$i = 1;
}
$i = strpos($path, '/', $i);
if ($i === false) {
$i = strlen($path);
}
$result_segments[] = substr($path, 0, $i);
$path = substr($path, $i);
}
}
}
}
}
}
}
}
return implode('', $result_segments);
}
示例2: Auth_Yadis_XRI
function Auth_Yadis_XRI($xri)
{
if (!Auth_Yadis_startswith($xri, 'xri://')) {
$xri = 'xri://' . $xri;
}
return $xri;
}
示例3: fetch
function fetch($url, $body = null, $headers = null)
{
$this->fetchlog[] = array($url, $body, $headers);
$u = parse_url($url);
$proxy_host = $u['host'];
$xri = $u['path'];
$query = Auth_OpenID::arrayGet($u, 'query');
if (!$headers && !$query) {
trigger_error('Error in mock XRI fetcher: no headers or query');
}
if (Auth_Yadis_startswith($xri, '/')) {
$xri = substr($xri, 1);
}
if (array_key_exists($xri, $this->documents)) {
list($ctype, $body) = $this->documents[$xri];
$status = 200;
} else {
$status = 404;
$ctype = 'text/plain';
$body = '';
}
return new Auth_Yadis_HTTPResponse($url, $status, array('content-type' => $ctype), $body);
}