From 78ec133603298eec8526fdc393f6ed46fda217ec Mon Sep 17 00:00:00 2001 From: "adrian.vasile.constantin" Date: Wed, 11 Apr 2012 18:04:12 +0000 Subject: [PATCH] New query parser method to also return the parser object when generating cache file git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10556 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/xml/XmlQueryParser.150.class.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/classes/xml/XmlQueryParser.150.class.php b/classes/xml/XmlQueryParser.150.class.php index 58cb239ac..ba4dd7d0a 100644 --- a/classes/xml/XmlQueryParser.150.class.php +++ b/classes/xml/XmlQueryParser.150.class.php @@ -57,8 +57,8 @@ return $theInstance; } - function parse($query_id = NULL, $xml_file = NULL, $cache_file = NULL) { - + function &parse_xml_query($query_id, $xml_file, $cache_file) + { // Read xml file $xml_obj = $this->getXmlFileContent($xml_file); @@ -66,10 +66,18 @@ $action = strtolower($xml_obj->query->attrs->action); if(!$action) return; + // Write query cache file $parser = new QueryParser($xml_obj->query); - FileHandler::writeFile($cache_file, $parser->toString()); + FileHandler::writeFile($cache_file, $parser->toString()); + + return $parser; } + function parse($query_id = NULL, $xml_file = NULL, $cache_file = NULL) + { + $query_parser = &$this->parse_xml_query($query_id, $xml_file, $cache_file); + } + function getXmlFileContent($xml_file){ $buff = FileHandler::readFile($xml_file); $xml_obj = parent::parse($buff);