Метод | Описание | |
---|---|---|
checkSAMLMessage ( string $message, string $type ) | This function performs some sanity checks on XML documents, and optionally validates them against their schema if the 'validatexml' debugging option is enabled. A warning will be printed to the log if validation fails. | |
debugSAMLMessage ( string | DOMElement $message, string $type ) | Helper function to log SAML messages that we send or receive. | |
formatDOMElement ( DOMElement $root, string $indentBase = '' ) | Format a DOM element. | |
formatXMLString ( string $xml, string $indentBase = '' ) : string | Format an XML string. | |
getDOMChildren ( DOMElement $element, string $localName, string $namespaceURI ) : array | This function finds direct descendants of a DOM element with the specified localName and namespace. They are returned in an array. | |
getDOMText ( DOMElement $element ) : string | This function extracts the text from DOMElements which should contain only text content. | |
isDOMElementOfType ( DOMNode $element, string $name, string $nsURI ) : boolean | This function checks if the DOMElement has the correct localName and namespaceURI. | |
isValid ( string | DOMDocument $xml, string $schema ) : boolean | string | This function attempts to validate an XML string against the specified schema. It will parse the string into a DOM document and validate this document against the schema. |
public static checkSAMLMessage ( string $message, string $type ) | ||
$message | string | The SAML document we want to check. |
$type | string | The type of document. Can be one of: - 'saml20' - 'saml11' - 'saml-meta' |
public static debugSAMLMessage ( string | DOMElement $message, string $type ) | ||
$message | string | DOMElement | The message, as an string containing the XML or an XML element. |
$type | string | Whether this message is sent or received, encrypted or decrypted. The following values are supported: - 'in': for messages received. - 'out': for outgoing messages. - 'decrypt': for decrypted messages. - 'encrypt': for encrypted messages. |
public static formatDOMElement ( DOMElement $root, string $indentBase = '' ) | ||
$root | DOMElement | The root element which should be formatted. |
$indentBase | string | The indentation this element should be assumed to have. Defaults to an empty string. |
public static getDOMChildren ( DOMElement $element, string $localName, string $namespaceURI ) : array | ||
$element | DOMElement | The element we should look in. |
$localName | string | The name the element should have. |
$namespaceURI | string | The namespace the element should have. |
Результат | array | Array with the matching elements in the order they are found. An empty array is returned if no elements match. |
public static getDOMText ( DOMElement $element ) : string | ||
$element | DOMElement | The element we should extract text from. |
Результат | string | The text content of the element. |
public static isDOMElementOfType ( DOMNode $element, string $name, string $nsURI ) : boolean | ||
$element | DOMNode | The element we should check. |
$name | string | The local name the element should have. |
$nsURI | string | The namespaceURI the element should have. |
Результат | boolean | True if both namespace and local name matches, false otherwise. |
public static isValid ( string | DOMDocument $xml, string $schema ) : boolean | string | ||
$xml | string | DOMDocument | The XML string or document which should be validated. |
$schema | string | The filename of the schema that should be used to validate the document. |
Результат | boolean | string | Returns a string with errors found if validation fails. True if validation passes ok. |