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

Class: Net_WebFinger

Source Location: /Net_WebFinger-0.3.2/src/Net/WebFinger.php

Class Overview


PHP WebFinger client. Performs discovery and returns a result.


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 39]
PHP WebFinger client. Performs discovery and returns a result.

Fetches the well-known WebFinger URI https://example.org/.well-known/webfinger?resource=acct:user@example.org

If that fails, the account's host's .well-known/host-meta file is fetched, then the file indicated by the "lrdd" type, as specificed by RFC 6415.

  1.  require_once 'Net/WebFinger.php';
  2.  $wf = new Net_WebFinger();
  3.  $react $wf->finger('user@example.org');
  4.  echo 'OpenID: ' $react->openid . "\n";



[ Top ]


Class Variables

$cache =

[line 62]

Cache object to use (PEAR Cache package).
  • Access: protected

Type:   Cache


[ Top ]

$fallbackToHttp =  false

[line 48]

Retry with HTTP if the HTTPS webfinger request fails.

This is not allowed by the webfinger specification, but may be helpful during development.

  • Access: public

Type:   boolean


[ Top ]

$httpClient =

[line 55]

HTTP client to use.
  • Access: protected

Type:   HTTP_Request2


[ Top ]



Method Detail

finger   [line 101]

Net_WebFinger_Reaction finger( string $identifier)

Finger a email address like identifier - get information about it.

If an error occurs, you find it in the reaction's $error property.


Parameters:

string   $identifier     E-mail address like identifier ("user@host")

[ Top ]

isHttps   [line 323]

boolean isHttps( string $url)

Check whether the URL is an HTTPS URL.
  • Return: True if it's a HTTPS url
  • Access: protected

Parameters:

string   $url     URL to check

[ Top ]

loadHostMeta   [line 182]

Net_WebFinger_Reaction loadHostMeta( string $host)

Load the host's .well-known/host-meta XRD file.

The XRD is stored in the reaction object's $source['host-meta'] property, and any error that is encountered in its $error property.

When the XRD file cannot be loaded, this method returns false.


Parameters:

string   $host     Hostname to fetch host-meta file from

[ Top ]

loadLrdd   [line 233]

Net_WebFinger_Reaction loadLrdd( string $identifier, string $host, $hostMeta)

Loads the user XRD file for a given identifier

The XRD is stored in the reaction object's $userXrd property, any error is stored in its $error property.


Parameters:

string   $identifier     E-mail address like identifier ("user@host")
string   $host     Hostname of $identifier
object   $hostMeta     host-meta XRD object

[ Top ]

loadWebfinger   [line 143]

Net_WebFinger_Reaction loadWebfinger( string $identifier, string $host)

Loads the webfinger JRD file for a given identifier

Parameters:

string   $identifier     E-mail address like identifier ("user@host")
string   $host     Hostname of $identifier

[ Top ]

loadXrd   [line 371]

boolean loadXrd( string $url)

Loads the XRD file from the given URL.

Sets $react->error when loading fails

  • Return: True if loading data succeeded, false if not
  • Access: protected

Parameters:

string   $url     URL to fetch

[ Top ]

loadXrdCached   [line 337]

Net_WebFinger_Reaction loadXrdCached( string $url)

Load an XRD file and caches it.

Parameters:

string   $url     URL to fetch

[ Top ]

mergeHostMeta   [line 283]

void mergeHostMeta( Net_WebFinger_Reaction $react, Net_WebFinger_Reaction $hostMeta)

Merges some properties from the hostMeta file into the reaction object
  • Access: protected

Parameters:

object   $react     Target reaction object
object   $hostMeta     Source hostMeta object

[ Top ]

setCache   [line 85]

void setCache( $cache)

Set a cache object that's used to buffer XRD files.
  • Access: public

Parameters:

Cache   $cache     PEAR cache object

[ Top ]

setHttpClient   [line 73]

void setHttpClient( $httpClient)

Set a HTTP client object that's used to fetch URLs.

Useful to set an own user agent.

  • Access: public

Parameters:

object   $httpClient     HTTP_Request2 instance

[ Top ]

verifyDescribes   [line 303]

void verifyDescribes( Net_WebFinger_Reaction $react, string $account)

Verifies that the reaction object is about the given account URL.

Sets the error property in the reaction object.

  • Access: protected

Parameters:

object   $react     Reaction object to check
string   $account     acct: URL that the reaction should be about

[ Top ]


Documentation generated on Mon, 04 Nov 2013 14:00:04 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.