2 /* vim: set expandtab sw=4 ts=4 sts=4: */
11 require_once './libraries/common.inc.php';
12 require_once './libraries/server_common.inc.php';
13 require './libraries/server_links.inc.php';
17 * Displays the sub-page heading
20 . ($GLOBALS['cfg']['MainPageIconic'] ?
'<img src="' . $pmaThemeImage . 's_process.png" width="16" height="16" border="0" hspace="2" align="middle" alt="" />' : '')
21 . ' ' . __('Processes') . "\n"
25 * Kills a selected process
27 if (!empty($_REQUEST['kill'])) {
28 if (PMA_DBI_try_query('KILL ' . $_REQUEST['kill'] . ';')) {
29 $message = PMA_Message
::success(__('Thread %s was successfully killed.'));
31 $message = PMA_Message
::error(__('phpMyAdmin was unable to kill thread %s. It probably has already been closed.'));
33 $message->addParam($_REQUEST['kill']);
37 $url_params = array();
39 if (! empty($_REQUEST['full'])) {
40 $sql_query = 'SHOW FULL PROCESSLIST';
41 $url_params['full'] = 1;
42 $full_text_link = 'server_processlist.php' . PMA_generate_common_url(array(), 'html', '?');
44 $sql_query = 'SHOW PROCESSLIST';
45 $full_text_link = 'server_processlist.php' . PMA_generate_common_url(array('full' => 1));
47 $result = PMA_DBI_query($sql_query);
53 <table id
="tableprocesslist" class="data">
56 <?php
if (!PMA_DRIZZLE
): ?
>
57 <th
><a href
="<?php echo $full_text_link; ?>"
58 title
="<?php echo empty($full) ? __('Show Full Queries') : __('Truncate Shown Queries'); ?>">
59 <img src
="<?php echo $pmaThemeImage . 's_' . (empty($_REQUEST['full']) ? 'full' : 'partial'); ?>text.png"
60 alt
="<?php echo empty($_REQUEST['full']) ? __('Show Full Queries') : __('Truncate Shown Queries'); ?>" />
65 <th
><?php
echo __('ID'); ?
></th
>
66 <th
><?php
echo __('User'); ?
></th
>
67 <th
><?php
echo __('Host'); ?
></th
>
68 <th
><?php
echo __('Database'); ?
></th
>
69 <th
><?php
echo __('Command'); ?
></th
>
70 <th
><?php
echo __('Time'); ?
></th
>
71 <th
><?php
echo __('Status'); ?
></th
>
72 <th
><?php
echo __('SQL query'); ?
></th
>
78 while($process = PMA_DBI_fetch_assoc($result)) {
80 // Drizzle uses uppercase keys
81 foreach ($process as $k => $v) {
83 ?
$k = ucfirst(strtolower($k))
88 $url_params['kill'] = $process['Id'];
89 $kill_process = 'server_processlist.php' . PMA_generate_common_url($url_params);
91 <tr
class="noclick <?php echo $odd_row ? 'odd' : 'even'; ?>">
92 <td
><a href
="<?php echo $kill_process ; ?>"><?php
echo __('Kill'); ?
></a
></td
>
93 <td
class="value"><?php
echo $process['Id']; ?
></td
>
94 <td
><?php
echo $process['User']; ?
></td
>
95 <td
><?php
echo $process['Host']; ?
></td
>
96 <td
><?php
echo ((! isset($process['db']) ||
! strlen($process['db'])) ?
'<i>' . __('None') . '</i>' : $process['db']); ?
></td
>
97 <td
><?php
echo $process['Command']; ?
></td
>
98 <td
class="value"><?php
echo $process['Time']; ?
></td
>
99 <td
><?php
echo (empty($process['State']) ?
'---' : $process['State']); ?
></td
>
100 <td
><?php
echo (empty($process['Info']) ?
'---' : PMA_SQP_formatHtml(PMA_SQP_parse($process['Info']))); ?
></td
>
103 $odd_row = ! $odd_row;
113 require './libraries/footer.inc.php';