forked from phpmyadmin/phpmyadmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver_binlog.php
109 lines (92 loc) · 3.7 KB
/
server_binlog.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* Does the common work
*/
require_once('./server_common.inc.php');
/**
* Displays the links
*/
require('./server_links.inc.php');
/**
* Displays the sub-page heading
*/
echo '<h2>' . "\n"
. ($cfg['MainPageIconic'] ? '<img src="' . $pmaThemeImage . 's_process.png" width="16" height="16" border="0" hspace="2" align="middle" />' : '' )
. ' ' . $strBinaryLog . "\n"
. '</h2>' . "\n";
if (!isset($log)) $log = '';
/**
* Display log selector.
*/
if (count($binary_logs) > 1) {
echo '<p><form action="server_binlog.php" method="get">';
echo PMA_generate_common_hidden_inputs();
echo $strSelectBinaryLog . ': ';
echo '<select name="log">';
foreach($binary_logs as $name) {
echo '<option value="' . $name . '"' . ($name == $log ? ' selected="selected"' : '') . '>' . $name . '</option>';
}
echo '</select>';
echo '<input type="submit" value="' . $strGo . '" />';
echo '</form><br /></p>';
}
$sql_query = 'SHOW BINLOG EVENTS';
if (!empty($log)) $sql_query .= ' IN \'' . $log . '\'';
/**
* Sends the query and buffers the result
*/
$serverProcesses = array();
$res = PMA_DBI_query($sql_query);
while ($row = PMA_DBI_fetch_assoc($res)) {
$serverProcesses[] = $row;
}
@PMA_DBI_free_result($res);
unset($res);
unset($row);
PMA_showMessage($GLOBALS['strSuccess']);
/**
* Displays the page
*/
?>
<table border="0" cellpadding="2" cellspacing="1">
<tr>
<td colspan="6" align="center"><a href="./server_binlog.php?<?php echo $url_query . (!empty($log) ? '&log=' . htmlspecialchars($log) : '' ) . (empty($full) ? '&full=1' : ''); ?>" title="<?php echo empty($full) ? $strShowFullQueries : $strTruncateQueries; ?>"><img src="<?php echo $pmaThemeImage . 's_' . (empty($full) ? 'full' : 'partial'); ?>text.png" width="50" height="20" border="0" alt="<?php echo empty($full) ? $strShowFullQueries : $strTruncateQueries; ?>" /></a></td>
</tr>
<tr>
<th> <?php echo $strBinLogName; ?> </th>
<th> <?php echo $strBinLogPosition; ?> </th>
<th> <?php echo $strBinLogEventType; ?> </th>
<th> <?php echo $strBinLogServerId; ?> </th>
<th> <?php echo $strBinLogOriginalPosition; ?> </th>
<th> <?php echo $strBinLogInfo; ?> </th>
</tr>
<?php
$useBgcolorOne = TRUE;
foreach ($serverProcesses as $value) {
if (empty($full) && PMA_strlen($value['Info']) > $GLOBALS['cfg']['LimitChars']) {
$value['Info'] = PMA_substr($value['Info'], 0, $GLOBALS['cfg']['LimitChars']) . '...';
}
?>
<tr>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> <?php echo $value['Log_name']; ?> </td>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align="right"> <?php echo $value['Pos']; ?> </td>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> <?php echo $value['Event_type']; ?> </td>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align="right"> <?php echo $value['Server_id']; ?> </td>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align="right"> <?php echo isset($value['Orig_log_pos']) ? $value['Orig_log_pos'] : $value['End_log_pos']; ?> </td>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> <?php echo htmlspecialchars($value['Info']); ?> </td>
</tr>
<?php
$useBgcolorOne = !$useBgcolorOne;
}
?>
<?php
?>
</table>
<?php
/**
* Sends the footer
*/
require_once('./footer.inc.php');
?>