import v1.1.0_beta1 | 2009-08-21

This commit is contained in:
2019-07-17 22:16:19 +02:00
parent 2c1152f0d3
commit 8dee6b1a10
2306 changed files with 251360 additions and 23428 deletions

View File

@ -17,24 +17,14 @@
* @subpackage Zend_InfoCard_Xml
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Element.php 9094 2008-03-30 18:36:55Z thomas $
* @version $Id: Element.php 15577 2009-05-14 12:43:34Z matthew $
*/
/**
* Zend_InfoCard_Xml_Exception
*/
require_once 'Zend/InfoCard/Xml/Exception.php';
/**
* Zend_InfoCard_Xml_Element_Interface
*/
require_once 'Zend/InfoCard/Xml/Element/Interface.php';
/**
* Zend_Loader
*/
require_once 'Zend/Loader.php';
/**
* An abstract class representing a an XML data block
*
@ -72,6 +62,7 @@ abstract class Zend_InfoCard_Xml_Element
if(!($dom instanceof DOMElement)) {
// Zend_InfoCard_Xml_Element exntes SimpleXMLElement, so this should *never* fail
// @codeCoverageIgnoreStart
require_once 'Zend/InfoCard/Xml/Exception.php';
throw new Zend_InfoCard_Xml_Exception("Failed to convert between SimpleXML and DOM");
// @codeCoverageIgnoreEnd
}
@ -89,12 +80,15 @@ abstract class Zend_InfoCard_Xml_Element
*/
static public function convertToObject(DOMElement $e, $classname)
{
Zend_Loader::loadClass($classname);
if (!class_exists($classname)) {
require_once 'Zend/Loader.php';
Zend_Loader::loadClass($classname);
}
$reflection = new ReflectionClass($classname);
if(!$reflection->isSubclassOf('Zend_InfoCard_Xml_Element')) {
require_once 'Zend/InfoCard/Xml/Exception.php';
throw new Zend_InfoCard_Xml_Exception("DOM element must be converted to an instance of Zend_InfoCard_Xml_Element");
}
@ -103,6 +97,7 @@ abstract class Zend_InfoCard_Xml_Element
if(!($sxe instanceof Zend_InfoCard_Xml_Element)) {
// Since we just checked to see if this was a subclass of Zend_infoCard_Xml_Element this shoudl never fail
// @codeCoverageIgnoreStart
require_once 'Zend/InfoCard/Xml/Exception.php';
throw new Zend_InfoCard_Xml_Exception("Failed to convert between DOM and SimpleXML");
// @codeCoverageIgnoreEnd
}