Public Member Functions | |
| executeFile ($file, $failOnError=true) | |
| getErrorMsg () | |
| & | parseStatements (&$sql) |
| SQLParser ($driver, &$dataSource, $debug=false) | |
| stripComments (&$sql) | |
Public Attributes | |
| $commentDelim | |
| $dataSource | |
| $debug | |
| $driver | |
| $statementDelim | |
Definition at line 18 of file SQLParser.inc.php.
| SQLParser.executeFile | ( | $ | file, | |
| $ | failOnError = true | |||
| ) |
Parse an SQL file and execute all SQL statements in it.
| $file | string full path to the file | |
| $failOnError | boolean stop execution if an error is encountered |
Definition at line 57 of file SQLParser.inc.php.
References parseStatements(), and stripComments().
| SQLParser.getErrorMsg | ( | ) |
Return the last error message that occurred in parsing.
Definition at line 143 of file SQLParser.inc.php.
| & SQLParser.parseStatements | ( | &$ | sql | ) |
Parse SQL content into individual SQL statements.
| $sql | string |
Definition at line 105 of file SQLParser.inc.php.
References String.regexp_match_all(), and String.substr_count().
Referenced by executeFile().
| SQLParser.SQLParser | ( | $ | driver, | |
| &$ | dataSource, | |||
| $ | debug = false | |||
| ) |
Constructor.
| $driver | string the database driver (currently only "mysql" is supported) | |
| $debug | boolean echo each statement as it's executed |
Definition at line 42 of file SQLParser.inc.php.
References $dataSource, $debug, and $driver.
| SQLParser.stripComments | ( | &$ | sql | ) |
Strip SQL comments from SQL string.
| $sql | string |
Definition at line 96 of file SQLParser.inc.php.
References String.regexp_replace().
Referenced by executeFile().
| SQLParser.$commentDelim |
Delimiter for SQL comments used by the data source
Definition at line 32 of file SQLParser.inc.php.
| SQLParser.$dataSource |
The database connection object
Definition at line 24 of file SQLParser.inc.php.
Referenced by SQLParser().
| SQLParser.$debug |
Enable debugging (print SQL statements as they are executed)
Definition at line 27 of file SQLParser.inc.php.
Referenced by SQLParser().
| SQLParser.$driver |
| SQLParser.$statementDelim |
Delimiter for SQL statements used by the data source
Definition at line 35 of file SQLParser.inc.php.
1.5.6