本文整理匯總了PHP中Auth_Yadis_XRI函數的典型用法代碼示例。如果您正苦於以下問題:PHP Auth_Yadis_XRI函數的具體用法?PHP Auth_Yadis_XRI怎麽用?PHP Auth_Yadis_XRI使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Auth_Yadis_XRI函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: runTest
function runTest()
{
$xris = array(array("@foo", "@"), array("@foo*bar", "@"), array("@*foo*bar", "@"), array("@foo/bar", "@"), array("!!990!991", "!"), array("!1001!02", "!"), array("=foo*bar", "="), array("(example.com)/foo", "(example.com)"), array("(example.com)*bar/foo", "(example.com)"), array("baz.example.com/foo", "baz.example.com"), array("baz.example.com:8080/foo", "baz.example.com:8080"));
foreach ($xris as $tupl) {
list($thexri, $expected_root) = $tupl;
$this->assertEquals(Auth_Yadis_XRI($expected_root), Auth_Yadis_rootAuthority($thexri), 'rootAuthority test (' . $thexri . ')');
}
}
示例2: _getCanonicalID
function _getCanonicalID($iname, $xrds, $expectedID)
{
if ($expectedID === null) {
$result = Auth_Yadis_getCanonicalID($iname, $xrds);
if ($result !== false) {
$this->fail($iname . ' (got ' . $result . ')');
}
} else {
$cid = Auth_Yadis_getCanonicalID($iname, $xrds);
$this->assertEquals(Auth_Yadis_XRI($expectedID), $cid);
}
}
示例3: Auth_Yadis_getCanonicalID
function Auth_Yadis_getCanonicalID($iname, $xrds)
{
// Returns false or a canonical ID value.
// Now nodes are in reverse order.
$xrd_list = array_reverse($xrds->allXrdNodes);
$parser = $xrds->parser;
$node = $xrd_list[0];
$canonicalID_nodes = $parser->evalXPath('xrd:CanonicalID', $node);
if (!$canonicalID_nodes) {
return false;
}
$canonicalID = $canonicalID_nodes[0];
$canonicalID = Auth_Yadis_XRI($parser->content($canonicalID));
$childID = $canonicalID;
for ($i = 1; $i < count($xrd_list); $i++) {
$xrd = $xrd_list[$i];
$parent_sought = substr($childID, 0, strrpos($childID, '!'));
$parentCID = $parser->evalXPath('xrd:CanonicalID', $xrd);
if (!$parentCID) {
return false;
}
$parentCID = Auth_Yadis_XRI($parser->content($parentCID[0]));
if (strcasecmp($parent_sought, $parentCID)) {
// raise XRDSFraud.
return false;
}
$childID = $parent_sought;
}
$root = Auth_Yadis_rootAuthority($iname);
if (!Auth_Yadis_providerIsAuthoritative($root, $childID)) {
// raise XRDSFraud.
return false;
}
return $canonicalID;
}
示例4: test_useCanonicalID
function test_useCanonicalID()
{
$endpoint = new Auth_OpenID_ServiceEndpoint();
$endpoint->claimed_id = Auth_Yadis_XRI("=!1000");
$endpoint->canonicalID = Auth_Yadis_XRI("=!1000");
$htis->assertEquals($endpoint->getLocalID(), Auth_Yadis_XRI("=!1000"));
}