Translated using Weblate (German)
[phpmyadmin.git] / server_status_processes.php
blobe46b07a8adda2f7afe7485205eef509f3fb39b32
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * displays the server status > processes list
6 * @package PhpMyAdmin
7 */
8 declare(strict_types=1);
10 use PhpMyAdmin\Response;
11 use PhpMyAdmin\Server\Status\Data;
12 use PhpMyAdmin\Server\Status\Processes;
14 require_once 'libraries/common.inc.php';
15 require_once 'libraries/server_common.inc.php';
17 /**
18 * Replication library
20 require_once 'libraries/replication.inc.php';
22 $serverStatusData = new Data();
23 $response = Response::getInstance();
25 /**
26 * Kills a selected process
27 * on ajax request
29 if ($response->isAjax() && !empty($_REQUEST['kill'])) {
30 $kill = intval($_REQUEST['kill']);
31 $query = $GLOBALS['dbi']->getKillQuery($kill);
32 if ($GLOBALS['dbi']->tryQuery($query)) {
33 $message = PhpMyAdmin\Message::success(
34 __('Thread %s was successfully killed.')
36 $response->setRequestStatus(true);
37 } else {
38 $message = PhpMyAdmin\Message::error(
39 __(
40 'phpMyAdmin was unable to kill thread %s.'
41 . ' It probably has already been closed.'
44 $response->setRequestStatus(false);
46 $message->addParam($kill);
47 $response->addJSON('message', $message);
48 } elseif ($response->isAjax() && !empty($_REQUEST['refresh'])) {
49 // Only sends the process list table
50 $response->addHTML(Processes::getHtmlForServerProcesslist());
51 } else {
52 // Load the full page
53 $header = $response->getHeader();
54 $scripts = $header->getScripts();
55 $scripts->addFile('server_status_processes.js');
56 $response->addHTML('<div>');
57 $response->addHTML($serverStatusData->getMenuHtml());
58 $response->addHTML(Processes::getHtmlForProcessListFilter());
59 $response->addHTML(Processes::getHtmlForServerProcesslist());
60 $response->addHTML(Processes::getHtmlForProcessListAutoRefresh());
61 $response->addHTML('</div>');
63 exit;