本文整理汇总了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"));
}