fromKVForm() static public method

static public fromKVForm ( $kvform_string )
Beispiel #1
0
 /**
  * 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;
 }
Beispiel #2
0
 /**
  * @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;
 }