本文整理汇总了PHP中Auth_OpenID_Message::fromKVForm方法的典型用法代码示例。如果您正苦于以下问题:PHP Auth_OpenID_Message::fromKVForm方法的具体用法?PHP Auth_OpenID_Message::fromKVForm怎么用?PHP Auth_OpenID_Message::fromKVForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Auth_OpenID_Message
的用法示例。
在下文中一共展示了Auth_OpenID_Message::fromKVForm方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _httpResponseToMessage
/**
* Adapt a POST response to a Message.
*
* @param $response Result of a POST to an OpenID endpoint.
*
* @access private
*/
static function _httpResponseToMessage($response, $server_url)
{
// Should this function be named Message.fromHTTPResponse instead?
$response_message = Auth_OpenID_Message::fromKVForm($response->body);
if ($response->status == 400) {
return Auth_OpenID_ServerErrorContainer::fromMessage($response_message);
} else {
if ($response->status != 200 and $response->status != 206) {
return null;
}
}
return $response_message;
}
示例2: _makeKVPost
/**
* @access private
*/
function _makeKVPost($message, $server_url)
{
$body = $message->toURLEncoded();
$resp = $this->fetcher->post($server_url, $body);
if ($resp === null) {
return null;
}
$response_message = Auth_OpenID_Message::fromKVForm($resp->body);
if ($resp->status == 400) {
return Auth_OpenID_ServerErrorContainer::fromMessage($response_message);
} else {
if ($resp->status != 200) {
return null;
}
}
return $response_message;
}