db_sql_format.php 453 B

1234567891011121314151617181920
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Format SQL for SQL editors
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. /**
  9. * Loading common files. Used to check for authorization, localization and to
  10. * load the parsing library.
  11. */
  12. require_once 'libraries/common.inc.php';
  13. $query = !empty($_POST['sql']) ? $_POST['sql'] : '';
  14. $query = SqlParser\Utils\Formatter::format($query);
  15. $response = PMA_Response::getInstance();
  16. $response->addJSON("sql", $query);