Update website
This commit is contained in:
parent
41ce1aa076
commit
ea0eb1c6e0
4222 changed files with 721797 additions and 14 deletions
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Controllers\Server\Status\Processes;
|
||||
|
||||
use PhpMyAdmin\Controllers\Server\Status\AbstractController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Http\ServerRequest;
|
||||
use PhpMyAdmin\Message;
|
||||
use PhpMyAdmin\ResponseRenderer;
|
||||
use PhpMyAdmin\Server\Status\Data;
|
||||
use PhpMyAdmin\Template;
|
||||
|
||||
use function __;
|
||||
|
||||
final class KillController extends AbstractController
|
||||
{
|
||||
/** @var DatabaseInterface */
|
||||
private $dbi;
|
||||
|
||||
public function __construct(ResponseRenderer $response, Template $template, Data $data, DatabaseInterface $dbi)
|
||||
{
|
||||
parent::__construct($response, $template, $data);
|
||||
$this->dbi = $dbi;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params Request parameters
|
||||
*/
|
||||
public function __invoke(ServerRequest $request, array $params): void
|
||||
{
|
||||
if (! $this->response->isAjax()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$kill = (int) $params['id'];
|
||||
$query = $this->dbi->getKillQuery($kill);
|
||||
|
||||
if ($this->dbi->tryQuery($query)) {
|
||||
$message = Message::success(
|
||||
__('Thread %s was successfully killed.')
|
||||
);
|
||||
$this->response->setRequestStatus(true);
|
||||
} else {
|
||||
$message = Message::error(
|
||||
__(
|
||||
'phpMyAdmin was unable to kill thread %s. It probably has already been closed.'
|
||||
)
|
||||
);
|
||||
$this->response->setRequestStatus(false);
|
||||
}
|
||||
|
||||
$message->addParam($kill);
|
||||
|
||||
$this->response->addJSON(['message' => $message]);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Controllers\Server\Status\Processes;
|
||||
|
||||
use PhpMyAdmin\Controllers\Server\Status\AbstractController;
|
||||
use PhpMyAdmin\ResponseRenderer;
|
||||
use PhpMyAdmin\Server\Status\Data;
|
||||
use PhpMyAdmin\Server\Status\Processes;
|
||||
use PhpMyAdmin\Template;
|
||||
|
||||
final class RefreshController extends AbstractController
|
||||
{
|
||||
/** @var Processes */
|
||||
private $processes;
|
||||
|
||||
public function __construct(ResponseRenderer $response, Template $template, Data $data, Processes $processes)
|
||||
{
|
||||
parent::__construct($response, $template, $data);
|
||||
$this->processes = $processes;
|
||||
}
|
||||
|
||||
public function __invoke(): void
|
||||
{
|
||||
$params = [
|
||||
'showExecuting' => $_POST['showExecuting'] ?? null,
|
||||
'full' => $_POST['full'] ?? null,
|
||||
'column_name' => $_POST['column_name'] ?? null,
|
||||
'order_by_field' => $_POST['order_by_field'] ?? null,
|
||||
'sort_order' => $_POST['sort_order'] ?? null,
|
||||
];
|
||||
|
||||
if (! $this->response->isAjax()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->render('server/status/processes/list', $this->processes->getList($params));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue