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

Class: XML_XRD

Source Location: /XML_XRD-0.3.1/src/XML/XRD.php

Class Overview

XML_XRD_PropertyAccess
   |
   --XML_XRD

Main class used to load XRD documents from string or file.


Author(s):

Version:

  • Release: @package_version@

Variables

Methods


Inherited Variables

Inherited Methods

Class: XML_XRD_PropertyAccess

XML_XRD_PropertyAccess::getProperties()
Get all properties with the given type
XML_XRD_PropertyAccess::offsetExists()
Check if the property with the given type exists
XML_XRD_PropertyAccess::offsetGet()
Return the highest ranked property with the given type
XML_XRD_PropertyAccess::offsetSet()
Not implemented.
XML_XRD_PropertyAccess::offsetUnset()
Not implemented.

Class Details

[line 38]
Main class used to load XRD documents from string or file.

After loading the file, access to links is possible with get() and getAll(), as well as foreach-iterating over the XML_XRD object.

Property access is possible with getProperties() and array access (foreach) on the XML_XRD object.

Verification that the subject/aliases match the requested URL can be done with describes().



[ Top ]


Class Variables

$aliases = array()

[line 66]

Array of subject alias strings
  • Access: public

Type:   array


[ Top ]

$expires =

[line 81]

Unix timestamp when the document expires.

NULL when no expiry date set.

  • Access: public

Type:   integer|null


[ Top ]

$id =

[line 88]

xml:id of the XRD document
  • Access: public

Type:   string|null


[ Top ]

$links = array()

[line 73]

Array of link objects
  • Access: public

Type:   array


[ Top ]

$loader =

[line 45]

XRD file/string loading dispatcher
  • Access: public

Type:   XML_XRD_Loader


[ Top ]

$serializer =

[line 52]

XRD serializing dispatcher
  • Access: public

Type:   XML_XRD_Serializer


[ Top ]

$subject =

[line 59]

XRD subject
  • Access: public

Type:   string


[ Top ]



Method Detail

describes   [line 145]

boolean describes( string $uri)

Checks if the XRD document describes the given URI.

This should always be used to make sure the XRD file is the correct one for e.g. the given host, and not a copycat.

Checks against the subject and aliases

  • Return: True or false
  • Access: public

Parameters:

string   $uri   —  An URI that the document is expected to describe

[ Top ]

get   [line 170]

XML_XRD_Element_Link get( string $rel, [string $type = null], [boolean $typeFallback = true])

Get the link with highest priority for the given relation and type.
  • Return: Link object or NULL if none found
  • Access: public

Parameters:

string   $rel   —  Relation name
string   $type   —  MIME Type
boolean   $typeFallback   —  When true and no link with the given type could be found, the best link without a type will be returned

[ Top ]

getAll   [line 192]

array getAll( string $rel, [string $type = null], [boolean $typeFallback = true])

Get all links with the given relation and type, highest priority first.
  • Return: Array of XML_XRD_Element_Link objects
  • Access: public

Parameters:

string   $rel   —  Relation name
string   $type   —  MIME Type
boolean   $typeFallback   —  When true and no link with the given type could be found, the best link without a type will be returned

[ Top ]

getIterator   [line 226]

Traversable getIterator( )

Return the iterator object to loop over the links

Part of the IteratorAggregate interface

  • Return: Iterator for the links
  • Access: public

[ Top ]

loadFile   [line 106]

void loadFile( string $file, [string $type = null])

Loads the contents of the given file.

Note: Only use file type auto-detection for local files. Do not use it on remote files as the file gets requested several times.

  • Throws: XML_XRD_Loader_Exception When the file is invalid or cannot be loaded
  • Access: public

Parameters:

string   $file   —  Path to an XRD file
string   $type   —  File type: xml or json, NULL for auto-detection

[ Top ]

loadString   [line 125]

void loadString( string $str, [string $type = null])

Loads the contents of the given string
  • Throws: XML_XRD_Loader_Exception When the string is invalid or cannot be loaded
  • Access: public

Parameters:

string   $str   —  XRD string
string   $type   —  File type: xml or json, NULL for auto-detection

[ Top ]

to   [line 238]

string to( string $type)

Converts this XRD object to XML or JSON.
  • Return: Generated content
  • Access: public

Parameters:

string   $type   —  Serialization type: xml or json

[ Top ]

toXML   [line 253]

string toXML( )

Converts this XRD object to XML.
  • Return: Generated XML
  • Deprecated: use to('xml')
  • Access: public

[ Top ]


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