diff -r 5b37998e522e -r 162c1de6545a web/lib/Zend/InfoCard/Xml/KeyInfo.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/InfoCard/Xml/KeyInfo.php Fri Mar 11 15:05:35 2011 +0100 @@ -0,0 +1,90 @@ +asXML(); + } else if (is_string($xmlData)) { + $strXmlData = $xmlData; + } else { + throw new Zend_InfoCard_Xml_Exception("Invalid Data provided to create instance"); + } + + $sxe = simplexml_load_string($strXmlData); + + $namespaces = $sxe->getDocNameSpaces(); + + if(!empty($namespaces)) { + foreach($sxe->getDocNameSpaces() as $namespace) { + switch($namespace) { + case 'http://www.w3.org/2000/09/xmldsig#': + include_once 'Zend/InfoCard/Xml/KeyInfo/XmlDSig.php'; + return simplexml_load_string($strXmlData, 'Zend_InfoCard_Xml_KeyInfo_XmlDSig'); + default: + + throw new Zend_InfoCard_Xml_Exception("Unknown KeyInfo Namespace provided"); + // We are ignoring these lines, as XDebug reports each as a "non executed" line + // which breaks my coverage % + // @codeCoverageIgnoreStart + } + } + } + // @codeCoverageIgnoreEnd + + include_once 'Zend/InfoCard/Xml/KeyInfo/Default.php'; + return simplexml_load_string($strXmlData, 'Zend_InfoCard_Xml_KeyInfo_Default'); + } +}