Auth_Yadis_XRDS
in package
This class performs parsing of XRDS documents.
You should not instantiate this class directly; rather, call parseXRDS statically:
$xrds = Auth_Yadis_XRDS::parseXRDS($xml_string);
If the XRDS can be parsed and is valid, an instance of Auth_Yadis_XRDS will be returned. Otherwise, null will be returned. This class is used by the Auth_Yadis_Yadis::discover method.
Table of Contents
- $allXrdNodes : mixed
- $parser : Auth_Yadis_XMLParser
- $serviceList : array<string|int, array<string|int, Auth_Yadis_Service>>
- $xrdNode : mixed
- __construct() : mixed
- Instantiate a Auth_Yadis_XRDS object. Requires an XPath instance which has been used to parse a valid XRDS document.
- _addService() : mixed
- _parse() : mixed
- Creates the service list using nodes from the XRDS XML document.
- parseXRDS() : mixed
- Parse an XML string (XRDS document) and return either a Auth_Yadis_XRDS object or null, depending on whether the XRDS XML is valid.
- services() : mixed
- Returns a list of service objects which correspond to <Service> elements in the XRDS XML document for this object.
Properties
$allXrdNodes
public
mixed
$allXrdNodes
$parser
public
Auth_Yadis_XMLParser
$parser
$serviceList
public
array<string|int, array<string|int, Auth_Yadis_Service>>
$serviceList
$xrdNode
public
mixed
$xrdNode
Methods
__construct()
Instantiate a Auth_Yadis_XRDS object. Requires an XPath instance which has been used to parse a valid XRDS document.
public
__construct(Auth_Yadis_XMLParser $xmlParser, array<string|int, mixed> $xrdNodes) : mixed
Parameters
- $xmlParser : Auth_Yadis_XMLParser
- $xrdNodes : array<string|int, mixed>
Return values
mixed —_addService()
public
_addService(int $priority, string $service) : mixed
Parameters
- $priority : int
- $service : string
Tags
Return values
mixed —_parse()
Creates the service list using nodes from the XRDS XML document.
public
_parse() : mixed
Tags
Return values
mixed —parseXRDS()
Parse an XML string (XRDS document) and return either a Auth_Yadis_XRDS object or null, depending on whether the XRDS XML is valid.
public
static parseXRDS(string $xml_string[, array<string|int, mixed>|null $extra_ns_map = null ]) : mixed
Parameters
- $xml_string : string
-
An XRDS XML string.
- $extra_ns_map : array<string|int, mixed>|null = null
Return values
mixed —$xrds An instance of Auth_Yadis_XRDS or null, depending on the validity of $xml_string
services()
Returns a list of service objects which correspond to <Service> elements in the XRDS XML document for this object.
public
services([mixed $filters = null ][, int $filter_mode = SERVICES_YADIS_MATCH_ANY ]) : mixed
Optionally, an array of filter callbacks may be given to limit the list of returned service objects. Furthermore, the default mode is to return all service objects which match ANY of the specified filters, but $filter_mode may be SERVICES_YADIS_MATCH_ALL if you want to be sure that the returned services match all the given filters. See for detailed usage information on filter functions.
Parameters
- $filters : mixed = null
-
An array of callbacks to filter the returned services, or null if all services are to be returned.
- $filter_mode : int = SERVICES_YADIS_MATCH_ANY
-
SERVICES_YADIS_MATCH_ALL or SERVICES_YADIS_MATCH_ANY, depending on whether the returned services should match ALL or ANY of the specified filters, respectively.
Return values
mixed —$services An array of objects if $filter_mode is a valid mode; null if $filter_mode is an invalid mode (i.e., not SERVICES_YADIS_MATCH_ANY or SERVICES_YADIS_MATCH_ALL).