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

Class: OpenID_Discover

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

Class Overview


OpenID_Discover


Author(s):

Copyright:

  • 2009 Bill Shupp

Variables

Methods


Child classes:

OpenID_Discover_HTML
Implements HTML discovery
OpenID_Discover_Yadis
Implements YADIS discovery

Inherited Variables

Inherited Methods


Class Details

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



[ Top ]


Class Variables

$discoveryOrder = array(
        0  => OpenID_Discover::TYPE_YADIS,
        10 => OpenID_Discover::TYPE_HTML
    )

[line 79]

Order that discover should be performed
  • Access: public

Type:   array


[ Top ]

$identifier =  null

[line 89]

The normalized version of the user supplied identifier
  • Access: protected

Type:   string


[ Top ]

$requestOptions = array(
        'follow_redirects' => true,
        'timeout'          => 3,
        'connect_timeout'  => 3
    )

[line 96]

HTTP_Request2 options
  • Access: protected

Type:   array


[ Top ]

$services =  null

[line 107]

Instance of OpenID_ServiceEndpoints
  • Access: protected



[ Top ]

$supportedTypes = array(
        self::TYPE_YADIS,
        self::TYPE_HTML
    )

[line 69]

List of supported discover types
  • Access: protected

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 116]

void __construct( mixed $identifier)

Constructor. Enables libxml internal errors, normalized the identifier.
  • Access: public

Overridden in child classes as:

OpenID_Discover_HTML::__construct()
Constructor. Sets the

Parameters:

mixed   $identifier   —  The user supplied identifier

[ Top ]

discover   [line 155]

bool discover( )

Performs discovery
  • Return: true on success, false on failure
  • Access: public

Overridden in child classes as:

OpenID_Discover_HTML::discover()
Performs HTML discovery.
OpenID_Discover_Yadis::discover()
Performs YADIS discovery

[ Top ]

extensionSupported   [line 220]

bool extensionSupported( string $extension)

Determines if dicovered information supports a given OpenID extension
  • Access: public

Parameters:

string   $extension   —  The name of the extension to check, (SREG10, AX, etc)

[ Top ]

getDiscover   [line 256]

OpenID_Discover|false getDiscover( string $id, OpenID_Store_Interface $store, [array $options = array()])

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

Parameters:

string   $id   —  URI Identifier to discover
OpenID_Store   $store   —  Instance of OpenID_Store
array   $options   —  Options to pass to HTTP_Request2

[ Top ]

setRequestOptions   [line 144]

OpenID_Discover setRequestOptions( array $options)

Sets the HTTP_Request2 options to use
  • Return: for fluent interface
  • Access: public

Parameters:

array   $options   —  Array of HTTP_Request2 options

[ Top ]

_factory   [line 185]

void _factory( string $discoverType, string $identifier)

Provides the standard factory pattern for loading discovery drivers.
  • Access: protected

Parameters:

string   $discoverType   —  The discovery type (driver) to load
string   $identifier   —  The user supplied identifier

[ Top ]

__get   [line 129]

mixed __get( string $name)

Gets member variables
  • Return: The member variable if it exists
  • Access: public

Parameters:

string   $name   —  Name of the member variable to get

[ Top ]


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