當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Auth_OpenID_discoverWithoutYadis函數代碼示例

本文整理匯總了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);
}
開發者ID:Tjorriemorrie,項目名稱:app,代碼行數:31,代碼來源:Discover.php

示例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);
}
開發者ID:openid,項目名稱:php-openid,代碼行數:30,代碼來源:Discover.php

示例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);
}
開發者ID:ramziammar,項目名稱:websites,代碼行數:32,代碼來源:Discover.php


注:本文中的Auth_OpenID_discoverWithoutYadis函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。