From 50f5a5aa14fce96133811e5abb56e5015e634d80 Mon Sep 17 00:00:00 2001 From: D4rk4ng3l Date: Sun, 19 Jun 2011 13:57:40 +0000 Subject: [PATCH] Fixed implementation of "Iterator" and "Traversable" interfaces. --- library/Msd/Sql/Parser.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/library/Msd/Sql/Parser.php b/library/Msd/Sql/Parser.php index 08a1174..4d40869 100644 --- a/library/Msd/Sql/Parser.php +++ b/library/Msd/Sql/Parser.php @@ -17,7 +17,7 @@ require_once "Msd/Sql/Parser/Interface.php"; * @package MySQLDumper * @subpackage SQL-Browser */ -class Msd_Sql_Parser implements Iterator, Traversable +class Msd_Sql_Parser implements Iterator { /** * Saves the raw MySQL Query. @@ -141,7 +141,7 @@ class Msd_Sql_Parser implements Iterator, Traversable $commentEnd = $this->_sqlComments[$commentCheck]; $endPos = strpos($sqlQuery, $commentEnd, $startPos) + strlen($commentEnd); $comment = substr($sqlQuery, $startPos, $endPos - $startPos); - $this->_parseStatement($comment, 'Msd_Sql_Parser_Comment'); + $this->_parseStatement($comment, 'Msd_Sql_Parser_Statement_Comment'); $startPos = $endPos; continue; } @@ -219,6 +219,16 @@ class Msd_Sql_Parser implements Iterator, Traversable return $parserObject->parse($statement); } + /** + * Returns the array with the parsed statements. + * + * @return array + */ + public function getParsedStatements() + { + return $this->_parsedStatements; + } + /** * Returns the parsing summary. *