本文整理汇总了PHP中Auth_OpenID_discoverWithoutYadis函数的典型用法代码示例。如果您正苦于以下问题:PHP Auth_OpenID_discoverWithoutYadis函数的具体用法?PHP Auth_OpenID_discoverWithoutYadis怎么用?PHP Auth_OpenID_discoverWithoutYadis使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Auth_OpenID_discoverWithoutYadis函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Auth_OpenID_discoverWithYadis
function Auth_OpenID_discoverWithYadis($uri, &$fetcher)
{
// Discover OpenID services for a URI. Tries Yadis and falls back
// on old-style <link rel='...'> discovery if Yadis fails.
// Might raise a yadis.discover.DiscoveryFailure if no document
// came back for that URI at all. I don't think falling back to
// OpenID 1.0 discovery on the same URL will help, so don't bother
// to catch it.
$openid_services = array();
$http_response = null;
$response = Services_Yadis_Yadis::discover($uri, $http_response, $fetcher);
if ($response) {
$identity_url = $response->uri;
$openid_services = $response->xrds->services(array('filter_MatchesAnyOpenIDType'));
}
if (!$openid_services) {
return @Auth_OpenID_discoverWithoutYadis($uri, $fetcher);
}
if (!$openid_services) {
$body = $response->body;
// Try to parse the response as HTML to get OpenID 1.0/1.1
// <link rel="...">
$service = Auth_OpenID_ServiceEndpoint::fromHTML($identity_url, $body);
if ($service !== null) {
$openid_services = array($service);
}
} else {
$openid_services = Auth_OpenID_makeOpenIDEndpoints($response->uri, $openid_services);
}
return array($identity_url, $openid_services, $http_response);
}
示例2: Auth_OpenID_discoverWithYadis
function Auth_OpenID_discoverWithYadis($uri, $fetcher, $endpoint_filter = 'Auth_OpenID_getOPOrUserServices', $discover_function = null)
{
// Discover OpenID services for a URI. Tries Yadis and falls back
// on old-style <link rel='...'> discovery if Yadis fails.
// Might raise a yadis.discover.DiscoveryFailure if no document
// came back for that URI at all. I don't think falling back to
// OpenID 1.0 discovery on the same URL will help, so don't bother
// to catch it.
if ($discover_function === null) {
$discover_function = array('Auth_Yadis_Yadis', 'discover');
}
$openid_services = array();
$response = call_user_func_array($discover_function, array($uri, $fetcher));
$yadis_url = $response->normalized_uri;
$yadis_services = array();
if ($response->isFailure() && !$response->isXRDS()) {
return array($uri, array());
}
$openid_services = Auth_OpenID_ServiceEndpoint::fromXRDS($yadis_url, $response->response_text);
if (!$openid_services) {
if ($response->isXRDS()) {
return Auth_OpenID_discoverWithoutYadis($uri, $fetcher);
}
// Try to parse the response as HTML to get OpenID 1.0/1.1
// <link rel="...">
$openid_services = Auth_OpenID_ServiceEndpoint::fromHTML($yadis_url, $response->response_text);
}
$openid_services = call_user_func_array($endpoint_filter, array($openid_services));
return array($yadis_url, $openid_services);
}
示例3: Auth_OpenID_discoverWithYadis
function Auth_OpenID_discoverWithYadis($uri, &$fetcher)
{
// Discover OpenID services for a URI. Tries Yadis and falls back
// on old-style <link rel='...'> discovery if Yadis fails.
// Might raise a yadis.discover.DiscoveryFailure if no document
// came back for that URI at all. I don't think falling back to
// OpenID 1.0 discovery on the same URL will help, so don't bother
// to catch it.
$openid_services = array();
$response = Auth_Yadis_Yadis::discover($uri, $fetcher);
$yadis_url = $response->normalized_uri;
$yadis_services = array();
if ($response->isFailure()) {
return array($uri, array());
}
$xrds =& Auth_Yadis_XRDS::parseXRDS($response->response_text);
if ($xrds) {
$yadis_services = $xrds->services(array('filter_MatchesAnyOpenIDType'));
}
if (!$yadis_services) {
if ($response->isXRDS()) {
return Auth_OpenID_discoverWithoutYadis($uri, $fetcher);
}
// Try to parse the response as HTML to get OpenID 1.0/1.1
// <link rel="...">
$openid_services = Auth_OpenID_ServiceEndpoint::fromHTML($yadis_url, $response->response_text);
} else {
$openid_services = Auth_OpenID_makeOpenIDEndpoints($yadis_url, $yadis_services);
}
$openid_services = Auth_OpenID_getOPOrUserServices($openid_services);
return array($yadis_url, $openid_services);
}