Translated using Weblate (French)
[phpmyadmin.git] / db_sql_format.php
blobbb7df923ded811d73197f4c8e1ad77200a7ddff6
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Format SQL for SQL editors
6 * @package PhpMyAdmin
7 */
8 declare(strict_types=1);
10 use PhpMyAdmin\Response;
12 /**
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);