1
0
Fork 0

Fixed implementation of "Iterator" and "Traversable" interfaces.

Dieser Commit ist enthalten in:
D4rk4ng3l 2011-06-19 13:57:40 +00:00
Ursprung 5c2c490d58
Commit 50f5a5aa14

Datei anzeigen

@ -17,7 +17,7 @@ require_once "Msd/Sql/Parser/Interface.php";
* @package MySQLDumper * @package MySQLDumper
* @subpackage SQL-Browser * @subpackage SQL-Browser
*/ */
class Msd_Sql_Parser implements Iterator, Traversable class Msd_Sql_Parser implements Iterator
{ {
/** /**
* Saves the raw MySQL Query. * Saves the raw MySQL Query.
@ -141,7 +141,7 @@ class Msd_Sql_Parser implements Iterator, Traversable
$commentEnd = $this->_sqlComments[$commentCheck]; $commentEnd = $this->_sqlComments[$commentCheck];
$endPos = strpos($sqlQuery, $commentEnd, $startPos) + strlen($commentEnd); $endPos = strpos($sqlQuery, $commentEnd, $startPos) + strlen($commentEnd);
$comment = substr($sqlQuery, $startPos, $endPos - $startPos); $comment = substr($sqlQuery, $startPos, $endPos - $startPos);
$this->_parseStatement($comment, 'Msd_Sql_Parser_Comment'); $this->_parseStatement($comment, 'Msd_Sql_Parser_Statement_Comment');
$startPos = $endPos; $startPos = $endPos;
continue; continue;
} }
@ -219,6 +219,16 @@ class Msd_Sql_Parser implements Iterator, Traversable
return $parserObject->parse($statement); return $parserObject->parse($statement);
} }
/**
* Returns the array with the parsed statements.
*
* @return array
*/
public function getParsedStatements()
{
return $this->_parsedStatements;
}
/** /**
* Returns the parsing summary. * Returns the parsing summary.
* *