Translated using Weblate (Dutch)
[phpmyadmin.git] / server_status_processes.php
blobf5dfb3c2660fac36a7ff9dcdaaacdc54ca5fd8cf
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * displays the server status > processes list
6 * @package PhpMyAdmin
7 */
9 require_once 'libraries/common.inc.php';
10 require_once 'libraries/server_common.inc.php';
11 require_once 'libraries/ServerStatusData.class.php';
12 require_once 'libraries/server_status_processes.lib.php';
14 /**
15 * Replication library
17 if (PMA_DRIZZLE) {
18 $GLOBALS['replication_info'] = array();
19 $GLOBALS['replication_info']['master']['status'] = false;
20 $GLOBALS['replication_info']['slave']['status'] = false;
21 } else {
22 include_once 'libraries/replication.inc.php';
23 include_once 'libraries/replication_gui.lib.php';
26 $ServerStatusData = new PMA_ServerStatusData();
27 $response = PMA_Response::getInstance();
29 /**
30 * Kills a selected process
31 * on ajax request
33 if ($response->isAjax() && !empty($_REQUEST['kill'])) {
34 $query = $GLOBALS['dbi']->getKillQuery((int)$_REQUEST['kill']);
35 if ($GLOBALS['dbi']->tryQuery($query)) {
36 $message = PMA_Message::success(__('Thread %s was successfully killed.'));
37 $response->isSuccess(true);
38 } else {
39 $message = PMA_Message::error(
40 __(
41 'phpMyAdmin was unable to kill thread %s.'
42 . ' It probably has already been closed.'
45 $response->isSuccess(false);
47 $message->addParam($_REQUEST['kill']);
48 $response->addJSON('message', $message);
49 } elseif ($response->isAjax() && !empty($_REQUEST['refresh'])) {
50 // Only sends the process list table
51 $response->addHTML(PMA_getHtmlForServerProcessList());
52 } else {
53 // Load the full page
54 $header = $response->getHeader();
55 $scripts = $header->getScripts();
56 $scripts->addFile('server_status_processes.js');
57 $response->addHTML('<div>');
58 $response->addHTML($ServerStatusData->getMenuHtml());
59 $response->addHTML(PMA_getHtmlForServerProcesses());
60 $response->addHTML(PMA_getHtmlForProcessListFilter());
61 $response->addHTML('</div>');
63 exit;