| Methods |
public
|
discover(string $identifier, bool $openid = false): XRDSServices|null
Discovers the services for particular identifier.
Discovers the services for particular identifier.
This function attempts to discover and obtain the XRDS document associated
with the identifier, parses the XRDS document and returns an array of
services.
If an XRDS document is not found, and $openid is set to true, this function
will also attempt to discover OpenID services by looking for link elements
with rel of openid.server or openid2.provider in the discovered HTML document.
Parameters
| $identifier |
the identifier
|
| $openid |
if true, performs additional discovery of OpenID services
by looking for link elements within the discovered document
|
|
#
|
public
|
discoverByHTMLLinks(string $url): XRDSServices
Obtains the OpenID services for particular identifier by scanning for link
elements in the returned document.
Obtains the OpenID services for particular identifier by scanning for link
elements in the returned document.
Note that this function does not use the YADIS protocol to scan for services.
To use the YADIS protocol, use discovery_get_services()
.
Parameters
Returns
an array of discovered services, or an empty array if no services
are found
|
#
|
protected
|
getXRDSDocument(string $url, bool $check = true, int $retries = 5): string|null
Obtains a XRDS document at a particular URL. Performs Yadis discovery if
the URL does not produce a XRDS document.
Obtains a XRDS document at a particular URL. Performs Yadis discovery if
the URL does not produce a XRDS document.
Parameters
| $url |
the URL
|
| $check |
whether to check the content type of the response is
application/xrds+xml
|
| $retries |
the number of tries to make
|
Returns
the contents of the XRDS document
|
#
|
protected
|
normalize(string $identifier): string
Normalises an identifier for discovery.
Normalises an identifier for discovery.
If the identifier begins with xri://, acct: or mailto:, this is stripped out. If the identifier
does not begin with a valid URI scheme, http:// is assumed and added to the
identifier.
Parameters
| $identifier |
the identifier to normalise
|
Returns
the normalised identifier
|
#
|
protected
|
parseXRDS(string $xrds): XRDSServices
Parses an XRDS document to return services available.
Parses an XRDS document to return services available.
Parameters
Returns
|
#
|
protected
|
getMetaHttpEquiv(string $equiv, string $html): mixed
Searches through an HTML document to obtain the value of a meta
element with a specified http-equiv attribute.
Searches through an HTML document to obtain the value of a meta
element with a specified http-equiv attribute.
Parameters
| $equiv |
the http-equiv attribute for which to search
|
| $html |
the HTML document to search
|
Returns
the value of the meta element, or FALSE if the element is not
found
|
#
|
protected
|
getLinkRel(string $rel, string $html): mixed
Searches through an HTML document to obtain the value of a link
element with a specified rel attribute.
Searches through an HTML document to obtain the value of a link
element with a specified rel attribute.
Parameters
| $rel |
the rel attribute for which to search
|
| $html |
the HTML document to search
|
Returns
the href of the link element, or FALSE if the element is not
found
|
#
|
protected
|
request(string $url, array<string>|string $headers = ''): HTTPResponse
Performs an HTTP request.
Performs an HTTP request.
Communication with the web server is conducted using libcurl where possible.
Where libcurl does not exist, then sockets will be used.
Note that the request must be properly prepared before passing onto this function.
For example, for POST requests, the Content-Type and Content-Length headers must be
included in $headers.
Parameters
| $url |
the URL
|
| $headers |
HTTP headers containing name => value pairs
|
|
#
|