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

Class: Net_WebFinger_Reaction

Source Location: /Net_WebFinger-0.4.0/src/Net/WebFinger/Reaction.php

Class Overview


The reaction (=result) of a (web)finger action.




Inherited Variables

Inherited Methods

Class Details

[line 59]
The reaction (=result) of a (web)finger action.

Returned by Net_WebFinger::finger().

Usage examples:

Check if the data have been exchanged in a secure manner:

  1.  if (!$react->secure{
  2.      die("Be suspicious! Data may not be trusted.\n");
  3.  }

Get the OpenID of the user:

  1.  if ($react->openid{
  2.      echo 'The user\'s OpenID is ' $react->openid . "\n";
  3.  }

Other short names are

  • contacts (Portable Contacts)
  • hcard
  • profile
  • xfn
Access any relation by their URL:
  1.  $foo $react->get('');
  2.  if ($foo !== null{
  3.      //do something
  4.  }

[ Top ]

Class Variables

$error =

[line 80]

Message describing the error that occured during fingering.

When no error happened, this variable is NULL.

A webfinger error object is an exception, so you can use

  1. $react->error->getMessage()
to get the error.

To get the reason for the error, an error object may have an encapsulated exception:

  1.  if ($react->error->getPrevious()) {
  2.      echo 'Reason for this error: '
  3.      . $react->error->getPrevious()->getMessage()) "\n";
  4.  }

  • Access: public

[ Top ]

$secure =  true

[line 94]

If the WebFinger result has been obtained from secure sources.

There might be a man-in-the-middle attack if it is not secure.

The result is considered secure when the XRD files have been obtained via HTTPS or the files were signed with XML signatures.

Also, the XRD files need to have the correct subject (or alias) set.

  • Access: public

Type:   boolean

[ Top ]

$shortNameMap = array(
        'contacts' => '',
        'hcard'    => '',
        'openid'   => '',
        'profile'  => '',
        'xfn'      => '',

[line 111]

Provides short names for common link relations.

Keys in this array may be used as class variable.

Type:   array

[ Top ]

$url =

[line 101]

URL from which the data have been fetched
  • Access: public

Type:   string

[ Top ]

Method Detail

__get   [line 150]

string __get( string $variable)

Easy property access to common link relations.


string   $variable   —  Requested class variable

[ Top ]

__isset   [line 134]

boolean __isset( string $variable)

Check if a given short name exists.

If it exists, you can use e.g.

  1. $react->openid
to get the openid URL. Note that this only checks if the short variable name exists, not if the variable has a value.


string   $variable   —  Requested class variable

[ Top ]

Documentation generated on Wed, 09 Dec 2015 23:09:25 +0000 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.