OpenID
[ class tree: OpenID ] [ index: OpenID ] [ all elements ]

Class: OpenID_Message

Source Location: /OpenID-0.4.0/OpenID/Message.php

Class Overview


OpenID_Message


Author(s):

Copyright:

  • 2009 Bill Shupp

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 38]
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.



[ Top ]


Class Variables

$data = array()

[line 48]

  • Access: protected

Type:   mixed


[ Top ]

$validFormats = array(self::FORMAT_KV,
                                    self::FORMAT_HTTP,
                                    self::FORMAT_ARRAY)

[line 44]

  • Access: protected

Type:   mixed


[ Top ]



Method Detail

addExtension   [line 247]

void addExtension( OpenID_Extension $extension)

Adds an extension to an OpenID_Message object.

Parameters:

OpenID_Extension   $extension   —  Instance of OpenID_Extension

[ Top ]

delete   [line 106]

void delete( string $name)

Deletes a key from a message
  • Access: public

Parameters:

string   $name   —  Key name

[ Top ]

__construct (Constructor)   [line 58]

void __construct( [mixed $message = null], [string $format = self::FORMAT_ARRAY])

Optionally instanciates this object with the contents of an OpenID message.
  • Access: public

Parameters:

mixed   $message   —  Message contents
string   $format   —  Source message format (KV, HTTP, or ARRAY)

[ Top ]

get   [line 72]

mixed get( string $name)

Gets the value of any key in this message.
  • Return: Value of key if set, defaults to null
  • Access: public

Parameters:

string   $name   —  Name of key

[ Top ]

getArrayFormat   [line 139]

array getArrayFormat( )

Gets the current message in ARRAY format

[ Top ]

getHTTPFormat   [line 128]

string getHTTPFormat( )

Gets the current message in HTTP (url encoded) format

[ Top ]

getKVFormat   [line 117]

string getKVFormat( )

Gets the current message in KV format

[ Top ]

getMessage   [line 156]

mixed getMessage( [string $format = self::FORMAT_ARRAY])

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

Parameters:

string   $format   —  One of the above three formats

[ Top ]

set   [line 88]

void set( string $name, mixed $val)

Sets a message key value.
  • Access: public

Parameters:

string   $name   —  Key name
mixed   $val   —  Key value

[ Top ]

setMessage   [line 194]

void setMessage( mixed $message, [mixed $format = self::FORMAT_ARRAY])

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

Parameters:

mixed   $message   —  Source message
mixed   $format   —  Source message format (OpenID_Message::FORMAT_KV, OpenID_Message::FORMAT_ARRAY, OpenID_Message::FORMAT_HTTP)

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:57:49 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.