Class OpenID_Message

Description

OpenID_Message

A class that handles any OpenID protocol messages, as described in section 4.1 of the OpenID 2.0 spec. You can set or get messages in one of 3 formats: Key Value (KV), Array, or HTTP. KV is described in the spec (4.1.1 of the 2.0 spec), HTTP is urlencoded key value pairs, as you would see them in a query string or an HTTP POST body.

Located in /OpenID/Message.php (line 38)


	
			
Class Constant Summary
 FORMAT_ARRAY = 'ARRAY'
 FORMAT_HTTP = 'HTTP'
 FORMAT_KV = 'KV'
Variable Summary
mixed $data
Method Summary
void addExtension (OpenID_Extension $extension)
void delete (string $name)
void __construct ([mixed $message = null], [string $format = self::FORMAT_ARRAY])
mixed get (string $name)
array getArrayFormat ()
string getHTTPFormat ()
string getKVFormat ()
mixed getMessage ([string $format = self::FORMAT_ARRAY])
void set (string $name, mixed $val)
void setMessage (mixed $message, [mixed $format = self::FORMAT_ARRAY])
Variables
mixed $data = array() (line 48)
  • access: protected
mixed $validFormats = array(self::FORMAT_KV,
self::FORMAT_HTTP,
self::FORMAT_ARRAY)
(line 44)
  • access: protected
Methods
addExtension (line 232)

Adds an extension to an OpenID_Message object.

void addExtension (OpenID_Extension $extension)
delete (line 103)

Deletes a key from a message

  • access: public
void delete (string $name)
  • string $name: Key name
Constructor __construct (line 58)

Optionally instanciates this object with the contents of an OpenID message.

  • access: public
void __construct ([mixed $message = null], [string $format = self::FORMAT_ARRAY])
  • mixed $message: Message contents
  • string $format: Source message format (KV, HTTP, or ARRAY)
get (line 72)

Gets the value of any key in this message.

  • return: Value of key if set, defaults to null
  • access: public
mixed get (string $name)
  • string $name: Name of key
getArrayFormat (line 136)

Gets the current message in ARRAY format

array getArrayFormat ()
getHTTPFormat (line 125)

Gets the current message in HTTP (url encoded) format

string getHTTPFormat ()
getKVFormat (line 114)

Gets the current message in KV format

string getKVFormat ()
getMessage (line 153)

Gets the message in one of three formats:

OpenID_Message::FORMAT_ARRAY (default) OpenID_Message::FORMAT_KV (KV pairs, OpenID response format) OpenID_Message::FORMAT_HTTP (url encoded pairs, for use in a query string)

  • return: array, kv string, or url query string paramters
  • throws: OpenID_Message_Exception When passed an invalid format argument
  • access: public
mixed getMessage ([string $format = self::FORMAT_ARRAY])
  • string $format: One of the above three formats
set (line 88)

Sets a message key value.

  • access: public
void set (string $name, mixed $val)
  • string $name: Key name
  • mixed $val: Key value
setMessage (line 188)

Sets message contents. Wipes out any existing message contents. Default source format is Array, but you can also use KV and HTTP formats.

  • access: public
void setMessage (mixed $message, [mixed $format = self::FORMAT_ARRAY])
  • mixed $message: Source message
  • mixed $format: Source message format (OpenID_Message::FORMAT_KV, OpenID_Message::FORMAT_ARRAY, OpenID_Message::FORMAT_HTTP)
Class Constants
FORMAT_ARRAY = 'ARRAY' (line 42)
FORMAT_HTTP = 'HTTP' (line 41)
FORMAT_KV = 'KV' (line 40)

Documentation generated on Tue, 15 Dec 2009 19:00:55 -0800 by phpDocumentor 1.4.3