SqlToArray class for parsing a file of somewhat structured SQL statements into an array
There are a number of limitations for this class, and it is expected that the SQL files are constructed specifically to work within these limitations:
1) A statement is terminated by a semi-colon followed by whitespace.
2) A comment is a line starting with whitespace followed by two hyphens
3) If a line contains $somestring$ then rules (1) and (2) are suspended until the next line after a line containing a matching $somestring$. Where the 'somestring' can be any sequence of letters, numbers and underscores, including the empty string.
Notable deficiency:
Any SQL quoting using ' or " is ignored. Consequently a semi-colon followed by whitespace, a $somestring$ delimiter or a comment line will be processed in the same way regardless of whether they are inside an SQL quoted string.
Located in /htdocs/SqlToArray.php (line 25)
Return the empty string if this line is an SQL comment
Limitations: Does not recognize trailing comments.
Add this line onto the current statement, detecting the end of the statement.
Limitations: Doesn't handle quoting very well at all, other than $delimiter$ for quoting function bodies.
Accessor for the array of parsed statements.
Documentation generated on Sun, 17 Jun 2012 10:28:01 +0000 by phpDocumentor 1.4.3