250 |
kaklik |
1 |
<?php |
|
|
2 |
/* $Id: server_binlog.php,v 2.9 2006/01/17 17:02:29 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 |
* Displays the links |
|
|
15 |
*/ |
|
|
16 |
require('./libraries/server_links.inc.php'); |
|
|
17 |
|
|
|
18 |
|
|
|
19 |
/** |
|
|
20 |
* Displays the sub-page heading |
|
|
21 |
*/ |
|
|
22 |
echo '<h2>' . "\n" |
|
|
23 |
. ($cfg['MainPageIconic'] ? '<img src="' . $pmaThemeImage . 's_process.png" width="16" height="16" border="0" hspace="2" align="middle" alt="" />' : '' ) |
|
|
24 |
. ' ' . $strBinaryLog . "\n" |
|
|
25 |
. '</h2>' . "\n"; |
|
|
26 |
|
|
|
27 |
if (!isset($log)) { |
|
|
28 |
$log = ''; |
|
|
29 |
} |
|
|
30 |
|
|
|
31 |
/** |
|
|
32 |
* Display log selector. |
|
|
33 |
*/ |
|
|
34 |
if (count($binary_logs) > 1) { |
|
|
35 |
echo '<form action="server_binlog.php" method="get">'; |
|
|
36 |
echo PMA_generate_common_hidden_inputs(); |
|
|
37 |
echo '<fieldset><legend>'; |
|
|
38 |
echo $strSelectBinaryLog; |
|
|
39 |
echo '</legend><select name="log">'; |
|
|
40 |
foreach ($binary_logs as $name) { |
|
|
41 |
echo '<option value="' . $name . '"' . ($name == $log ? ' selected="selected"' : '') . '>' . $name . '</option>'; |
|
|
42 |
} |
|
|
43 |
echo '</select>'; |
|
|
44 |
echo '</fieldset>'; |
|
|
45 |
echo '<fieldset class="tblFooters">'; |
|
|
46 |
echo '<input type="submit" value="' . $strGo . '" />'; |
|
|
47 |
echo '</fieldset>'; |
|
|
48 |
echo '</form>'; |
|
|
49 |
} |
|
|
50 |
|
|
|
51 |
|
|
|
52 |
$sql_query = 'SHOW BINLOG EVENTS'; |
|
|
53 |
if (!empty($log)) { |
|
|
54 |
$sql_query .= ' IN \'' . $log . '\''; |
|
|
55 |
} |
|
|
56 |
|
|
|
57 |
/** |
|
|
58 |
* Sends the query and buffers the result |
|
|
59 |
*/ |
|
|
60 |
$serverProcesses = array(); |
|
|
61 |
$res = PMA_DBI_query($sql_query); |
|
|
62 |
while ($row = PMA_DBI_fetch_assoc($res)) { |
|
|
63 |
$serverProcesses[] = $row; |
|
|
64 |
} |
|
|
65 |
@PMA_DBI_free_result($res); |
|
|
66 |
unset($res); |
|
|
67 |
unset($row); |
|
|
68 |
|
|
|
69 |
PMA_showMessage($GLOBALS['strSuccess']); |
|
|
70 |
|
|
|
71 |
|
|
|
72 |
/** |
|
|
73 |
* Displays the page |
|
|
74 |
*/ |
|
|
75 |
?> |
|
|
76 |
<table border="0" cellpadding="2" cellspacing="1"> |
|
|
77 |
<tr> |
|
|
78 |
<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> |
|
|
79 |
</tr> |
|
|
80 |
<tr> |
|
|
81 |
<th> <?php echo $strBinLogName; ?> </th> |
|
|
82 |
<th> <?php echo $strBinLogPosition; ?> </th> |
|
|
83 |
<th> <?php echo $strBinLogEventType; ?> </th> |
|
|
84 |
<th> <?php echo $strBinLogServerId; ?> </th> |
|
|
85 |
<th> <?php echo $strBinLogOriginalPosition; ?> </th> |
|
|
86 |
<th> <?php echo $strBinLogInfo; ?> </th> |
|
|
87 |
</tr> |
|
|
88 |
<?php |
|
|
89 |
$useBgcolorOne = TRUE; |
|
|
90 |
foreach ($serverProcesses as $value) { |
|
|
91 |
if (empty($full) && PMA_strlen($value['Info']) > $GLOBALS['cfg']['LimitChars']) { |
|
|
92 |
$value['Info'] = PMA_substr($value['Info'], 0, $GLOBALS['cfg']['LimitChars']) . '...'; |
|
|
93 |
} |
|
|
94 |
?> |
|
|
95 |
<tr> |
|
|
96 |
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> <?php echo $value['Log_name']; ?> </td> |
|
|
97 |
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align="right"> <?php echo $value['Pos']; ?> </td> |
|
|
98 |
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> <?php echo $value['Event_type']; ?> </td> |
|
|
99 |
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align="right"> <?php echo $value['Server_id']; ?> </td> |
|
|
100 |
<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> |
|
|
101 |
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> <?php echo htmlspecialchars($value['Info']); ?> </td> |
|
|
102 |
</tr> |
|
|
103 |
<?php |
|
|
104 |
$useBgcolorOne = !$useBgcolorOne; |
|
|
105 |
} |
|
|
106 |
?> |
|
|
107 |
<?php |
|
|
108 |
?> |
|
|
109 |
</table> |
|
|
110 |
<?php |
|
|
111 |
|
|
|
112 |
|
|
|
113 |
/** |
|
|
114 |
* Sends the footer |
|
|
115 |
*/ |
|
|
116 |
require_once('./libraries/footer.inc.php'); |
|
|
117 |
|
|
|
118 |
?> |