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

Class: Services_Yadis_Xri

Source Location: /Services_Yadis-0.5.2/Services/Yadis/Xri.php

Class Overview


Provides methods for translating an XRI into a URI.


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 65]
Provides methods for translating an XRI into a URI.


[ Top ]


Class Variables

$canonicalID =  null

[line 120]

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 = array()

[line 122]

  • Access: protected

Type:   mixed


[ Top ]

$httpResponse =  null

[line 138]

The last response using HTTP_Request2
  • Access: protected

Type:   HTTP_Request2_Response


[ Top ]

$instance =  null

[line 73]

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

Type:   Services_Yadis_Xri


[ Top ]

$namespace =  null

[line 98]

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



[ Top ]

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

[line 90]

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

Type:   string


[ Top ]

$requests = array()

[line 131]

Stores an array of previously performed requests. The array key is a combination of the url, service type, and http request options.

Type:   array


[ Top ]

$uri =  null

[line 112]

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

Type:   string


[ Top ]

$xri =  null

[line 105]

The XRI string.
  • Access: protected

Type:   string


[ Top ]

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

[line 81]

  • Access: protected

Type:   mixed


[ Top ]



Method Detail

__construct (Constructor)   [line 143]

Services_Yadis_Xri __construct( )

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

[ Top ]

get   [line 383]

HTTP_Request get( string $url, [string $serviceType = null])

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   $url   —  URI
string   $serviceType   —  Optional service type

[ Top ]

getCanonicalId   [line 335]

string getCanonicalId( )

Gets the Canonical ID
  • Throws: Services_Yadis_Exception if the XRI is null
  • Access: public

[ Top ]

getHttpRequestOptions   [line 367]

array getHttpRequestOptions( )

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

[ Top ]

getHTTPResponse   [line 414]

HTTP_Request2_Response|null getHTTPResponse( )

Returns the most recent HTTP_Request2_Response object.
  • Access: public

[ Top ]

getInstance   [line 152]

Services_Yadis_Xri getInstance( )

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

[ Top ]

getProxy   [line 198]

string getProxy( )

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

[ Top ]

getXri   [line 230]

string getXri( )

Return the original XRI string.
  • Access: public

[ Top ]

setHttpRequestOptions   [line 356]

Services_Yadis_Xri setHttpRequestOptions( array $options)

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

Parameters:

array   $options   —  Array of HTTP_Request2 options

[ Top ]

setNamespace   [line 168]

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   —  Instance

[ Top ]

setProxy   [line 182]

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   —  The Proxy server URI

[ Top ]

setXri   [line 211]

Services_Yadis_Xri setXri( string $xri)

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

Parameters:

string   $xri   —  XRI to be translated

[ Top ]

toCanonicalId   [line 294]

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   —  The XRI

[ Top ]

toUri   [line 247]

string toUri( [string $xri = null], [string $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   —  XRI
string   $serviceType   —  The Service Type

[ Top ]


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