Class OpenID_Discover

Description

OpenID_Discover

Implements OpenID discovery (7.3 of the 2.0 spec). Discovery is driver based, and currently supports YADIS discovery (via Services_Yadis), and HTML discovery (OpenID_Discover_HTML). Once completed, it will also support XRD/LRDD.

Example usage for determining the OP Endpoint URL:

  1.  $id 'http://user.example.com';
  2.  
  3.  $discover new OpenID_Discover($id);
  4.  $result   $discover->discover();
  5.  
  6.  if (!$result{
  7.      echo "Discovery failed\n";
  8.  else {
  9.      // Grab the highest priority service, and get it's first URI.
  10.      $endpoint      $discover->services[0];
  11.      $opEndpointURL array_shift($serviceEndpoint->getURIs());
  12.  }

Located in /OpenID/Discover.php (line 61)


	
			
Direct descendents
Class Description
OpenID_Discover_HTML Implements HTML discovery
OpenID_Discover_Yadis Implements YADIS discovery
Class Constant Summary
 TYPE_HTML = 'HTML'
 TYPE_YADIS = 'Yadis'
Variable Summary
Method Summary
static OpenID_Discover|false getDiscover (string $id, OpenID_Store_Interface $store)
void __construct (mixed $identifier)
bool discover ()
bool extensionSupported (string $extension)
mixed __get (string $name)
Variables
static array $discoveryOrder = array(
0 => OpenID_Discover::TYPE_YADIS,
10 => OpenID_Discover::TYPE_HTML
)
(line 81)

Order that discover should be performed

  • access: public
string $identifier = null (line 91)

The normalized version of the user supplied identifier

  • access: protected

Redefined in descendants as:
array $requestOptions = array(
'adapter' => 'curl',
'follow_redirects' => true,
'timeout' => 3,
'connect_timeout' => 3
)
(line 98)

HTTP_Request2 options

  • access: protected
OpenID_ServiceEndpoints $services = null (line 110)

Instance of OpenID_ServiceEndpoints

  • access: protected
array $supportedTypes = array(
self::TYPE_YADIS,
self::TYPE_HTML
)
(line 71)

List of supported discover types

  • access: protected
Methods
static method getDiscover (line 253)

Static helper method for retrieving discovered information from cache if it exists, otherwise executing discovery and storing results if they are positive.

  • return: OpenID_Discover on success, false on failure
  • access: public
static OpenID_Discover|false getDiscover (string $id, OpenID_Store_Interface $store)
  • string $id: URI Identifier to discover
  • OpenID_Store $store: Instance of OpenID_Store
Constructor __construct (line 119)

Constructor. Enables libxml internal errors, normalized the identifier.

  • access: public
void __construct (mixed $identifier)
  • mixed $identifier: The user supplied identifier

Redefined in descendants as:
discover (line 158)

Performs discovery

  • return: true on success, false on failure
  • access: public
bool discover ()

Redefined in descendants as:
extensionSupported (line 219)

Determines if dicovered information supports a given OpenID extension

  • access: public
bool extensionSupported (string $extension)
  • string $extension: The name of the extension to check, (SREG10, AX, etc)
setRequestOptions (line 147)

Sets the HTTP_Request2 options to use

  • return: for fluent interface
  • access: public
OpenID_Discover setRequestOptions ( $options)
  • array $options: Array of HTTP_Request2 options
__get (line 132)

Gets member variables

  • return: The member variable if it exists
  • access: public
mixed __get (string $name)
  • string $name: Name of the member variable to get
Class Constants
TYPE_HTML = 'HTML' (line 64)
TYPE_YADIS = 'Yadis' (line 63)

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