diff options
author | Dan Ungureanu <udan1107@gmail.com> | 2015-08-01 00:59:38 +0300 |
---|---|---|
committer | Dan Ungureanu <udan1107@gmail.com> | 2015-08-01 00:59:38 +0300 |
commit | ade277dae57faed6c496c77b58d6904f7b9cec50 (patch) | |
tree | 96967f05f74715624760b7d04b476a03b06a1293 /db_sql_format.php | |
parent | e274f47c519a69329be732593324dc6da42851e3 (diff) |
Using the sql-parser library for formatting the queries.
Updated sql-parser library to udan11/sql-parser@e6a562e3e5bfbbbc03d469e50d65d063cac9ebd4.
Signed-off-by: Dan Ungureanu <udan1107@gmail.com>
Diffstat (limited to 'db_sql_format.php')
-rw-r--r-- | db_sql_format.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/db_sql_format.php b/db_sql_format.php index a83e5273ee..610b3e22aa 100644 --- a/db_sql_format.php +++ b/db_sql_format.php @@ -6,13 +6,15 @@ * @package PhpMyAdmin */ +/** + * Loading common files. Used to check for authorization, localization and to + * load the parsing library. + */ require_once 'libraries/common.inc.php'; -require_once 'libraries/sql-formatter/lib/SqlFormatter.php'; -$query = isset($_POST['sql']) ? $_POST['sql'] : ''; +$query = !empty($_POST['sql']) ? $_POST['sql'] : ''; -SqlFormatter::$tab = "\t"; -$query = SqlFormatter::format($query, false); +$query = SqlParser\Utils\Formatter::format($query); $response = PMA_Response::getInstance(); $response->addJSON("sql", $query); |