1
0
mirror of https://github.com/phpmyadmin/phpmyadmin.git synced 2026-10-28 07:41:55 +03:00
Files
phpmyadmin/libraries/classes/Controllers/Server/SqlController.php
Maurício Meneghini Fauth e6ec9df84e Remove DBI dep from Controllers/AbstractController
Moves the DatabaseInterface class dependency to the classes that use it.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-10-11 22:48:44 -03:00

52 lines
1.2 KiB
PHP

<?php
/**
* Holds the PhpMyAdmin\Controllers\Server\SqlController
*/
declare(strict_types=1);
namespace PhpMyAdmin\Controllers\Server;
use PhpMyAdmin\Common;
use PhpMyAdmin\Config\PageSettings;
use PhpMyAdmin\Controllers\AbstractController;
use PhpMyAdmin\Response;
use PhpMyAdmin\SqlQueryForm;
use PhpMyAdmin\Template;
/**
* Server SQL executor
*/
class SqlController extends AbstractController
{
/** @var SqlQueryForm */
private $sqlQueryForm;
/**
* @param Response $response
*/
public function __construct($response, Template $template, SqlQueryForm $sqlQueryForm)
{
parent::__construct($response, $template);
$this->sqlQueryForm = $sqlQueryForm;
}
public function index(): void
{
$this->addScriptFiles([
'makegrid.js',
'vendor/jquery/jquery.uitablefilter.js',
'vendor/stickyfill.min.js',
'sql.js',
]);
$pageSettings = new PageSettings('Sql');
$this->response->addHTML($pageSettings->getErrorHTML());
$this->response->addHTML($pageSettings->getHTML());
Common::server();
$this->response->addHTML($this->sqlQueryForm->getHtml());
}
}