Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
optometrists
/
cache
/
cache
/
cache
/
cache
/
cache
/
cache
/
.wp-cli
/
wp-content
/
plugins
/
wp-phpmyadmin-extension
/
lib
/
phpMyAdmin
/
libraries
/
classes
/
Controllers
/
Database
:
SqlFormatController.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php declare(strict_types=1); namespace PhpMyAdmin\Controllers\Database; use PhpMyAdmin\SqlParser\Utils\Formatter; use function strlen; /** * Format SQL for SQL editors. */ class SqlFormatController extends AbstractController { public function __invoke(): void { $params = ['sql' => $_POST['sql'] ?? null]; $query = strlen((string) $params['sql']) > 0 ? $params['sql'] : ''; $this->response->addJSON(['sql' => Formatter::format($query)]); } }