public static function parseFileXML($filepath, $entityId = null, $desiredNameIdFormat = null, $desiredSSOBinding = OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT, $desiredSLOBinding = OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT)
    {
        $metadataInfo = array();

        try {
            if (file_exists($filepath)) {
                $data = file_get_contents($filepath);
                $metadataInfo = self::parseXML($data, $entityId, $desiredNameIdFormat, $desiredSSOBinding, $desiredSLOBinding);
            }
        } catch (Exception $e) {
        }
        return $metadataInfo;
    }
public static function parseFileXML($filepath, $entityId = null, $desiredNameIdFormat = null, $desiredSSOBinding = OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT, $desiredSLOBinding = OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT)
    {
        $metadataInfo = array();

        try {
            if (file_exists($filepath)) {
                $data = file_get_contents($filepath);
                $metadataInfo = self::parseXML($data, $entityId, $desiredNameIdFormat, $desiredSSOBinding, $desiredSLOBinding);
            }
        } catch (Exception $e) {
        }
        return $metadataInfo;
    }
public static function parseFileXML ( $ filepath , $ entityId = null , $ desiredNameIdFormat = null , $ desiredSSOBinding = OneLogin_Saml2_Constants :: BINDING_HTTP_REDIRECT , $ desiredSLOBinding = OneLogin_Saml2_Constants :: BINDING_HTTP_REDIRECT ) { $ metadataInfo = array ( ) ; try { if ( file_exists ( $ filepath ) ) { $ data = file_get_contents ( $ filepath ) ; $ metadataInfo = self :: parseXML ( $ data , $ entityId , $ desiredNameIdFormat , $ desiredSSOBinding , $ desiredSLOBinding ) ; } } catch ( Exception $ e ) { } return $ metadataInfo ; }
Get IdP Metadata Info from File

@param string $filepath              File path
@param string $entityId              Entity Id of the desired IdP, if no
entity Id is provided and the XML
metadata contains more than one
IDPSSODescriptor, the first is returned
@param string $desiredNameIdFormat   If available on IdP metadata, use that nameIdFormat
@param string $desiredSSOBinding     Parse specific binding SSO endpoint.
@param string $desiredSLOBinding     Parse specific binding SLO endpoint.

@return array metadata info in php-saml settings format
Get IdP Metadata Info from File