_findClassbyURI($uri); $this->_transformList[] = array('uri' => $uri, 'class' => $class); return $this; } /** * Return the list of transforms to perform * * @return array The list of transforms */ public function getTransformList() { return $this->_transformList; } /** * Apply the transforms in the transform list to the input XML document * * @param string $strXmlDocument The input XML * @return string The XML after the transformations have been applied */ public function applyTransforms($strXmlDocument) { foreach($this->_transformList as $transform) { if (!class_exists($transform['class'])) { #require_once 'Zend/Loader.php'; Zend_Loader::loadClass($transform['class']); } $transformer = new $transform['class']; // We can't really test this check because it would require logic changes in the component itself // @codeCoverageIgnoreStart if(!($transformer instanceof Zend_InfoCard_Xml_Security_Transform_Interface)) { #require_once 'Zend/InfoCard/Xml/Security/Exception.php'; throw new Zend_InfoCard_Xml_Security_Exception("Transforms must implement the Transform Interface"); } // @codeCoverageIgnoreEnd $strXmlDocument = $transformer->transform($strXmlDocument); } return $strXmlDocument; } }