本文整理匯總了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);
}