250 |
kaklik |
1 |
<?php |
|
|
2 |
/* $Id: server_processlist.php,v 2.16 2006/01/14 23:17:15 cybot_tm Exp $ */ |
|
|
3 |
// vim: expandtab sw=4 ts=4 sts=4: |
|
|
4 |
|
|
|
5 |
require_once('./libraries/common.lib.php'); |
|
|
6 |
|
|
|
7 |
/** |
|
|
8 |
* Does the common work |
|
|
9 |
*/ |
|
|
10 |
require_once('./libraries/server_common.inc.php'); |
|
|
11 |
|
|
|
12 |
|
|
|
13 |
/** |
|
|
14 |
* Kills a selected process |
|
|
15 |
*/ |
|
|
16 |
if (!empty($kill)) { |
|
|
17 |
if (PMA_DBI_try_query('KILL ' . $kill . ';')) { |
|
|
18 |
$message = sprintf($strThreadSuccessfullyKilled, $kill); |
|
|
19 |
} else { |
|
|
20 |
$message = sprintf($strCouldNotKill, $kill); |
|
|
21 |
} |
|
|
22 |
} |
|
|
23 |
|
|
|
24 |
|
|
|
25 |
/** |
|
|
26 |
* Displays the links |
|
|
27 |
*/ |
|
|
28 |
require('./libraries/server_links.inc.php'); |
|
|
29 |
|
|
|
30 |
|
|
|
31 |
/** |
|
|
32 |
* Displays the sub-page heading |
|
|
33 |
*/ |
|
|
34 |
echo '<h2>' . "\n" |
|
|
35 |
. ($cfg['MainPageIconic'] ? '<img class="icon" src="' . $pmaThemeImage . 's_process.png" width="16" height="16" alt="" />' : '' ) |
|
|
36 |
. $strProcesslist . "\n" |
|
|
37 |
. '</h2>' . "\n"; |
|
|
38 |
|
|
|
39 |
|
|
|
40 |
/** |
|
|
41 |
* Sends the query and buffers the result |
|
|
42 |
*/ |
|
|
43 |
$sql_query = 'SHOW' . ( empty( $full ) ? '' : ' FULL' ) . ' PROCESSLIST'; |
|
|
44 |
$serverProcesses = PMA_DBI_fetch_result( $sql_query ); |
|
|
45 |
|
|
|
46 |
PMA_showMessage( $GLOBALS['strSuccess'] ); |
|
|
47 |
|
|
|
48 |
|
|
|
49 |
/** |
|
|
50 |
* Displays the page |
|
|
51 |
*/ |
|
|
52 |
?> |
|
|
53 |
<table id="tableprocesslist" class="data"> |
|
|
54 |
<thead> |
|
|
55 |
<tr><td><a href="./server_processlist.php?<?php echo $url_query . (empty($full) ? '&full=1' : ''); ?>" |
|
|
56 |
title="<?php echo empty($full) ? $strShowFullQueries : $strTruncateQueries; ?>"> |
|
|
57 |
<img src="<?php echo $pmaThemeImage . 's_' . (empty($full) ? 'full' : 'partial'); ?>text.png" |
|
|
58 |
width="50" height="20" alt="<?php echo empty($full) ? $strShowFullQueries : $strTruncateQueries; ?>" /> |
|
|
59 |
</a></td> |
|
|
60 |
<th><?php echo $strId; ?></th> |
|
|
61 |
<th><?php echo $strUser; ?></th> |
|
|
62 |
<th><?php echo $strHost; ?></th> |
|
|
63 |
<th><?php echo $strDatabase; ?></th> |
|
|
64 |
<th><?php echo $strCommand; ?></th> |
|
|
65 |
<th><?php echo $strTime; ?></th> |
|
|
66 |
<th><?php echo $strStatus; ?></th> |
|
|
67 |
<th><?php echo $strSQLQuery; ?></th> |
|
|
68 |
</tr> |
|
|
69 |
</thead> |
|
|
70 |
<tbody> |
|
|
71 |
<?php |
|
|
72 |
$odd_row = true; |
|
|
73 |
foreach ( $serverProcesses AS $process ) { |
|
|
74 |
?> |
|
|
75 |
<tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>"> |
|
|
76 |
<td><a href="./server_processlist.php?<?php echo $url_query . '&kill=' . $process['Id']; ?>"><?php echo $strKill; ?></a></td> |
|
|
77 |
<td class="value"><?php echo $process['Id']; ?></td> |
|
|
78 |
<td><?php echo $process['User']; ?></td> |
|
|
79 |
<td><?php echo $process['Host']; ?></td> |
|
|
80 |
<td><?php echo (( ! isset( $process['db'] ) || ! strlen($process['db']) ) ? '<i>' . $strNone . '</i>' : $process['db']); ?></td> |
|
|
81 |
<td><?php echo $process['Command']; ?></td> |
|
|
82 |
<td class="value"><?php echo $process['Time']; ?></td> |
|
|
83 |
<td><?php echo (empty($process['State']) ? '---' : $process['State']); ?></td> |
|
|
84 |
<td><?php echo (empty($process['Info']) ? '---' : PMA_SQP_formatHtml(PMA_SQP_parse($process['Info']))); ?></td> |
|
|
85 |
</tr> |
|
|
86 |
<?php |
|
|
87 |
$odd_row = ! $odd_row; |
|
|
88 |
} |
|
|
89 |
?> |
|
|
90 |
</tbody> |
|
|
91 |
</table> |
|
|
92 |
<?php |
|
|
93 |
|
|
|
94 |
/** |
|
|
95 |
* Sends the footer |
|
|
96 |
*/ |
|
|
97 |
require_once('./libraries/footer.inc.php'); |
|
|
98 |
?> |