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


PHP Auth_OpenID_AX_toTypeURIs函數代碼示例

本文整理匯總了PHP中Auth_OpenID_AX_toTypeURIs函數的典型用法代碼示例。如果您正苦於以下問題:PHP Auth_OpenID_AX_toTypeURIs函數的具體用法?PHP Auth_OpenID_AX_toTypeURIs怎麽用?PHP Auth_OpenID_AX_toTypeURIs使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了Auth_OpenID_AX_toTypeURIs函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: test_two

 function test_two()
 {
     $uri1 = 'http://janrain.com/';
     $alias1 = 'openid_hackers';
     $this->aliases->addAlias($uri1, $alias1);
     $uri2 = 'http://jyte.com/';
     $alias2 = 'openid_hack';
     $this->aliases->addAlias($uri2, $alias2);
     $uris = Auth_OpenID_AX_toTypeURIs($this->aliases, implode(',', array($alias1, $alias2)));
     $this->assertEquals(array($uri1, $uri2), $uris);
 }
開發者ID:Stony-Brook-University,項目名稱:doitsbu,代碼行數:11,代碼來源:AX.php

示例2: parseExtensionArgs

 /**
  * Given attribute exchange arguments, populate this FetchRequest.
  *
  * @return $result Auth_OpenID_AX_Error if the data to be parsed
  * does not follow the attribute exchange specification. At least
  * when 'if_available' or 'required' is not specified for a
  * particular attribute type.  Returns true otherwise.
  */
 function parseExtensionArgs($ax_args)
 {
     $result = $this->_checkMode($ax_args);
     if (Auth_OpenID_AX::isError($result)) {
         return $result;
     }
     $aliases = new Auth_OpenID_NamespaceMap();
     foreach ($ax_args as $key => $value) {
         if (strpos($key, 'type.') === 0) {
             $alias = substr($key, 5);
             $type_uri = $value;
             $alias = $aliases->addAlias($type_uri, $alias);
             if ($alias === null) {
                 return new Auth_OpenID_AX_Error(sprintf("Could not add alias %s for URI %s", $alias, $type_uri));
             }
             $count_s = Auth_OpenID::arrayGet($ax_args, 'count.' . $alias);
             if ($count_s) {
                 $count = Auth_OpenID::intval($count_s);
                 if ($count === false && $count_s === Auth_OpenID_AX_UNLIMITED_VALUES) {
                     $count = $count_s;
                 }
             } else {
                 $count = 1;
             }
             if ($count === false) {
                 return new Auth_OpenID_AX_Error(sprintf("Integer value expected for %s, got %s", 'count.' . $alias, $count_s));
             }
             $attrinfo = Auth_OpenID_AX_AttrInfo::make($type_uri, $count, false, $alias);
             if (Auth_OpenID_AX::isError($attrinfo)) {
                 return $attrinfo;
             }
             $this->add($attrinfo);
         }
     }
     $required = Auth_OpenID_AX_toTypeURIs($aliases, Auth_OpenID::arrayGet($ax_args, 'required'));
     foreach ($required as $type_uri) {
         $attrib =& $this->requested_attributes[$type_uri];
         $attrib->required = true;
     }
     $if_available = Auth_OpenID_AX_toTypeURIs($aliases, Auth_OpenID::arrayGet($ax_args, 'if_available'));
     $all_type_uris = array_merge($required, $if_available);
     foreach ($aliases->iterNamespaceURIs() as $type_uri) {
         if (!in_array($type_uri, $all_type_uris)) {
             return new Auth_OpenID_AX_Error(sprintf('Type URI %s was in the request but not ' . 'present in "required" or "if_available"', $type_uri));
         }
     }
     $this->update_url = Auth_OpenID::arrayGet($ax_args, 'update_url');
     return true;
 }
開發者ID:kaantunc,項目名稱:MYK-BOR,代碼行數:57,代碼來源:AX.php


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