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

Class: Services_Yadis_Xri

Source Location: /Services_Yadis-0.2.2/Yadis/Xri.php

Class Overview


Provides methods for translating an XRI into a URI.


Author(s):

  • Pádraic Brady (http://blog.astrumfutura.com)

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 58]
Provides methods for translating an XRI into a URI.
  • Author: Pádraic Brady (http://blog.astrumfutura.com)
  • License: New BSD License


[ Top ]


Class Variables

$_canonicalId =  null

[line 113]

A Canonical ID if requested, and parsed from the XRDS document found by requesting the URI created from a valid XRI.
  • Access: protected

Type:   string


[ Top ]

$_httpRequestOptions =  null

[line 115]

  • Access: protected

Type:   mixed


[ Top ]

$_instance =  null

[line 66]

Hold an instance of this object per the Singleton Pattern.
  • Access: protected

Type:   Services_Yadis_Xri


[ Top ]

$_namespace =  null

[line 91]

Instance of Services_Yadis_Xrds_Namespace for managing namespaces associated with an XRDS document.
  • Access: protected



[ Top ]

$_proxy =  'http://xri.net/'

[line 83]

Default proxy to append XRI identifier to when forming a valid URI.
  • Access: protected

Type:   string


[ Top ]

$_uri =  null

[line 105]

The URI as translated from an XRI and appended to a Proxy.
  • Access: protected

Type:   string


[ Top ]

$_xri =  null

[line 98]

The XRI string.
  • Access: protected

Type:   string


[ Top ]

$_xriIdentifiers = array(
        '=', '$', '!', '@', '+'
    )

[line 74]

  • Access: protected

Type:   mixed


[ Top ]



Method Detail

__construct (Constructor)   [line 120]

Services_Yadis_Xri __construct( )

Constructor; protected since this class is a singleton.
  • Access: protected

[ Top ]

getCanonicalId   [line 287]

void getCanonicalId( )

  • Access: public

[ Top ]

getHttpRequestOptions   [line 315]

array getHttpRequestOptions( )

Get options to be passed to the PEAR HTTP_Request constructor
  • Access: public

[ Top ]

getInstance   [line 128]

Services_Yadis_Xri getInstance( )

Return a singleton instance of this class.
  • Access: public

[ Top ]

getProxy   [line 171]

void getProxy( string $proxy)

Return the URI of the current proxy.
  • Access: public

Parameters:

string   $proxy   — 

[ Top ]

getXri   [line 201]

string getXri( )

Return the original XRI string.
  • Access: public

[ Top ]

setHttpRequestOptions   [line 305]

void setHttpRequestOptions( array $options)

Set options to be passed to the PEAR HTTP_Request constructor
  • Access: public

Parameters:

array   $options   — 

[ Top ]

setNamespace   [line 143]

Services_Yadis_Xri setNamespace( Services_Yadis_Xrds_Namespace $namespace)

Set a Namespace object which contains all relevant namespaces for XPath queries on this Yadis resource.
  • Access: public

Parameters:

Services_Yadis_Xrds_Namespace   $namespace   — 

[ Top ]

setProxy   [line 156]

Services_Yadis_Xri setProxy( string $proxy)

Set an XRI proxy URI. A default of "http://xri.net/" is available.
  • Throws: Services_Yadis_Exception
  • Access: public

Parameters:

string   $proxy   — 

[ Top ]

setXri   [line 183]

Services_Yadis_Xri setXri( $xri, string $url)

Set an XRI to be translated to a URI.
  • Throws: Services_Yadis_Exception
  • Access: public

Parameters:

string   $url   — 
   $xri   — 

[ Top ]

toCanonicalId   [line 259]

string toCanonicalId( [string $xri = null])

Based on an XRI, will request the XRD document located at the proxy prefixed URI and parse in search of the XRI Canonical Id. This is a flexible requirement. OpenID 2.0 requires the use of the Canonical ID instead of the raw i-name. 2idi.com, on the other hand, does not.
  • Todo: Imcomplete; requires interface from Yadis main class
  • Throws: Services_Yadis_Exception
  • Access: public

Parameters:

string   $xri   — 

[ Top ]

toUri   [line 216]

string toUri( [string $xri = null], [ $serviceType = null])

Attempts to convert an XRI into a URI. In simple terms this involves removing the "xri://" prefix and appending the remainder to the URI of an XRI proxy such as "http://xri.net/".
  • Throws: Services_Yadis_Exception
  • Access: public
  • Uses: Validate

Parameters:

string   $xri   — 
   $serviceType   — 

[ Top ]

_get   [line 329]

HTTP_Request _get( $url, [ $serviceType = null], [array $options = null], string $uri)

Required to request the root i-name (XRI) XRD which will provide an error message that the i-name does not exist, or else return a valid XRD document containing the i-name's Canonical ID.
  • Todo: Finish this a bit better using the QXRI rules.
  • Access: protected

Parameters:

string   $uri   — 
   $url   — 
   $serviceType   — 
array   $options   — 

[ Top ]


Documentation generated on Thu, 10 Dec 2015 05:51:13 +0000 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.