本文整理匯總了PHP中Auth_OpenID_makeOpenIDEndpoints函數的典型用法代碼示例。如果您正苦於以下問題:PHP Auth_OpenID_makeOpenIDEndpoints函數的具體用法?PHP Auth_OpenID_makeOpenIDEndpoints怎麽用?PHP Auth_OpenID_makeOpenIDEndpoints使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Auth_OpenID_makeOpenIDEndpoints函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: runTest
function runTest()
{
// Parse into endpoint objects that we will check
$xrds_object = Auth_Yadis_XRDS::parseXRDS($this->xrds);
$endpoints = array();
if ($xrds_object) {
$endpoints = $xrds_object->services(array('filter_MatchesAnyOpenIDType'));
$endpoints = Auth_OpenID_makeOpenIDEndpoints($this->yadis_url, $endpoints);
}
// make sure there are the same number of endpoints as
// URIs. This assumes that the type_uris contains at least one
// OpenID type.
$this->assertEquals(count($this->uris), count($endpoints), "URI <-> Endpoint count");
// So that we can check equality on the endpoint types
$type_uris = $this->type_uris;
sort($type_uris);
$seen_uris = array();
foreach ($endpoints as $endpoint) {
$seen_uris[] = $endpoint->server_url;
// All endpoints will have same yadis_url
$this->assertEquals($this->yadis_url, $endpoint->claimed_id);
// and delegate
$this->assertEquals($this->local_id, $endpoint->local_id);
// and types
$actual_types = $endpoint->type_uris;
sort($actual_types);
$this->assertEquals($actual_types, $type_uris);
}
// So that they will compare equal, because we don't care what
// order they are in
sort($seen_uris);
$uris = $this->uris;
sort($uris);
// Make sure we saw all URIs, and saw each one once
$this->assertEquals($uris, $seen_uris);
}
示例2: discover_user
function discover_user($domain, $claimed_id, $fetcher)
{
$site_url = $this->fetch_host_meta($domain, $fetcher);
if ($site_url == null) {
return;
}
$site_xrds = $this->fetch_xrds_services($domain, $site_url, $fetcher);
list($user_url, $next_authority) = $this->get_user_xrds_url($site_xrds, $claimed_id);
$user_xrds = $this->fetch_xrds_services($next_authority, $user_url, $fetcher, false);
if ($user_xrds != null) {
$services = $user_xrds->services(array('filter_MatchesAnyOpenIDType'));
$endpoints = Auth_OpenID_makeOpenIDEndpoints($claimed_id, $services);
return array($claimed_id, $endpoints);
}
}
示例3: _Auth_OpenID_discoverXRI
function _Auth_OpenID_discoverXRI($iname, &$fetcher)
{
$services = new Services_Yadis_ProxyResolver($fetcher);
list($canonicalID, $service_list) = $services->query($iname, array(_OPENID_1_0_TYPE, _OPENID_1_1_TYPE, _OPENID_1_2_TYPE), array('filter_MatchesAnyOpenIDType'));
$endpoints = Auth_OpenID_makeOpenIDEndpoints($iname, $service_list);
for ($i = 0; $i < count($endpoints); $i++) {
$endpoints[$i]->canonicalID = $canonicalID;
}
// FIXME: returned xri should probably be in some normal form
return array($iname, $endpoints, null);
}
示例4: fromXRDS
static function fromXRDS($uri, $xrds_text)
{
$xrds = Auth_Yadis_XRDS::parseXRDS($xrds_text);
if ($xrds) {
$yadis_services = $xrds->services(array('filter_MatchesAnyOpenIDType'));
return Auth_OpenID_makeOpenIDEndpoints($uri, $yadis_services);
}
return null;
}
示例5: Auth_OpenID_discoverXRI
function Auth_OpenID_discoverXRI($iname, &$fetcher)
{
$resolver = new Auth_Yadis_ProxyResolver($fetcher);
list($canonicalID, $yadis_services) = $resolver->query($iname, Auth_OpenID_getOpenIDTypeURIs(), array('filter_MatchesAnyOpenIDType'));
$openid_services = Auth_OpenID_makeOpenIDEndpoints($iname, $yadis_services);
$openid_services = Auth_OpenID_getOPOrUserServices($openid_services);
for ($i = 0; $i < count($openid_services); $i++) {
$openid_services[$i]->canonicalID = $canonicalID;
$openid_services[$i]->claimed_id = $canonicalID;
}
// FIXME: returned xri should probably be in some normal form
return array($iname, $openid_services);
}