2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Format SQL for SQL editors
8 declare(strict_types
=1);
10 use PhpMyAdmin\Response
;
13 * Loading common files. Used to check for authorization, localization and to
14 * load the parsing library.
16 require_once 'libraries/common.inc.php';
18 $query = !empty($_POST['sql']) ?
$_POST['sql'] : '';
20 $query = PhpMyAdmin\SqlParser\Utils\Formatter
::format($query);
22 $response = Response
::getInstance();
23 $response->addJSON("sql", $query);