diff --git a/conlite/classes/class.xmlparser.php b/conlite/classes/class.clxmlparser.php similarity index 85% rename from conlite/classes/class.xmlparser.php rename to conlite/classes/class.clxmlparser.php index f71022e..0a832f9 100644 --- a/conlite/classes/class.xmlparser.php +++ b/conlite/classes/class.clxmlparser.php @@ -7,9 +7,6 @@ * Description: * Contenido XML Parser * - * Requirements: - * @con_php_req 5.0 - * * * @package Contenido_XML * @version 1.0.9 @@ -19,79 +16,17 @@ * @link http://www.4fb.de * @link http://www.contenido.org * @since file available since contenido release <= 4.6 - * - * {@internal - * created unknown - * modified 2008-06-30, Dominik Ziegler, add security fix - * - * $Id$: - * }} - * */ + if (!defined('CON_FRAMEWORK')) { die('Illegal call'); } - -/** - * Class for parsing XML documents using SAX - * - * This class is a abstraction class for the PHP Expat XML functions. - * - * You can define handler functions/objects for start, end, PI and data sections (1.) or - * your can define path which will trigger the defined event when encountered (2.) - * - * Example: - * - * 1.) $parser->setEvents(array("startElement"=> "myFunction", - * "endElement"=> "myFunction", - * "characterData"=> "myFunction", - * "processingInstruction" => "myFunction"); - * - * The value can also be an array with the object reference and the method to call. - * i.e. "startElement"=>array(&$myObj, "myMethod") instead of "startelement"=>"myFunction" - * - * 2.) $parser->setEvents(array("/root/foo/bar"=>"myFunction")); - * - * Valid array keys are: 'startElement', 'endElement', 'characterData', 'processingInstruction' and paths - * folowing the scheme '/root/element'. The path MUST begin from the root element and MUST start with '/'. - * - * The value can also be an array with the object reference and the method to call. - * i.e. "/foo/bar"=>array(&$myObj, "myMethod") instead of "/foo/bar"=>"myFunction" - * - * It has 3 public methods: - * - * setEventHandlers - Set specific handlers for the xml parser - * parseFile - Used to parse a XML file - * parse - Used to parse a XML string - * - * A small example: - * - * include ("class.xmlparser.php"); - * - * // The XML String - * $xml = ' - * - * - * some text - * another text - * '; - * - * function myHandler($name, $attribs, $content) - * { - * echo "HIT: [ $name ] [ $content ]
"; - * } - * - * $parser = new XmlParser; // Parser instance - * $parser->setEventHandlers(array("/foo/bar"=>"myHandler")); // Define our handler - * $parser->parse($xml); // Parse the XML string - * - * Report bugs to: jan.lengowski@4fb.de - * + /** * @author Jan Lengowski * @copyright four for business AG * @version 1.0 */ -class XmlParser { +class clXmlParser { /** * XML Parser autofree diff --git a/conlite/classes/contenido/class.module.php b/conlite/classes/contenido/class.module.php index aa9a6ff..8278f56 100644 --- a/conlite/classes/contenido/class.module.php +++ b/conlite/classes/contenido/class.module.php @@ -499,7 +499,7 @@ class cApiModule extends Item { private function _parseImportFile($sFile, $sType = "module", $sEncoding = "ISO-8859-1") { global $_mImport; - $oParser = new XmlParser($sEncoding); + $oParser = new clXmlParser($sEncoding); if ($sType == "module") { $oParser->setEventHandlers(array("/module/name" => "cHandler_ModuleData", @@ -1133,7 +1133,7 @@ class cApiModuleTranslationCollection extends ItemCollection { public function import($idmod, $idlang, $file) { global $_mImport; - $parser = new XmlParser("ISO-8859-1"); + $parser = new clXmlParser("ISO-8859-1"); $parser->setEventHandlers(array("/module/translation/string/original" => "cHandler_ItemName", "/module/translation/string/translation" => "cHandler_Translation")); diff --git a/data/config/production/config.autoloader.php b/data/config/production/config.autoloader.php index c144032..25bc141 100644 --- a/data/config/production/config.autoloader.php +++ b/data/config/production/config.autoloader.php @@ -249,7 +249,7 @@ return array( 'ArtSpecCollection' => 'conlite/classes/class.artspec.php', 'ArtSpecItem' => 'conlite/classes/class.artspec.php', 'Layout' => 'conlite/classes/class.layout.php', - 'XmlParser' => 'conlite/classes/class.xmlparser.php', + 'clXmlParser' => 'conlite/classes/class.clxmlparser.php', 'Contenido_UrlBuilder_CustomPath' => 'conlite/classes/UrlBuilder/Contenido_UrlBuilder_CustomPath.class.php', 'Contenido_UrlBuilder_Frontcontent' => 'conlite/classes/UrlBuilder/Contenido_UrlBuilder_Frontcontent.class.php', 'Contenido_UrlBuilderFactory' => 'conlite/classes/UrlBuilder/Contenido_UrlBuilderFactory.class.php',