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