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


PHP Auth_Yadis_XRI函數代碼示例

本文整理匯總了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 . ')');
     }
 }
開發者ID:Jobava,項目名稱:diacritice-meta-repo,代碼行數:8,代碼來源:XRI.php

示例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);
     }
 }
開發者ID:Jobava,項目名稱:diacritice-meta-repo,代碼行數:12,代碼來源:XRDS.php

示例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;
}
開發者ID:Blu2z,項目名稱:implsk,代碼行數:35,代碼來源:XRI.php

示例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"));
 }
開發者ID:BGCX067,項目名稱:ezopenid-svn-to-git,代碼行數:7,代碼來源:Discover_OpenID.php


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