improved displaying of binary logs:

- limit displayed rows to $cfg[MaxRows]
 - show single and summary log file size (MySQL >= 5.0.7)
cleaned up the code
added some more sanity checks
source documentation
This commit is contained in:
Sebastian Mendel
2007-03-13 09:55:19 +00:00
parent 177d054d2a
commit a56222d99a
3 changed files with 207 additions and 68 deletions

View File

@@ -1,11 +1,19 @@
<?php
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
/* vim: expandtab sw=4 ts=4 sts=4: */
/**
* @uses PMA_generate_common_url()
* @uses PMA_isSuperuser()
* @uses PMA_DBI_select_db()
* @uses PMA_DBI_fetch_result()
* @uses PMA_DBI_QUERY_STORE
* @uses $userlink
* @version $Id$
*/
/**
* Gets some core libraries
*/
require_once('./libraries/common.lib.php');
require_once './libraries/common.lib.php';
/**
* Handles some variables that may have been sent by the calling script
@@ -30,30 +38,21 @@ $err_url = 'main.php' . $url_query;
/**
* Displays the headers
*/
require_once('./libraries/header.inc.php');
require_once './libraries/header.inc.php';
/**
* Checks for superuser privileges
* @global boolean Checks for superuser privileges
*/
$is_superuser = PMA_isSuperuser();
$is_superuser = PMA_isSuperuser();
// now, select the mysql db
if ($is_superuser) {
PMA_DBI_select_db('mysql', $userlink);
}
$has_binlogs = FALSE;
$binlogs = PMA_DBI_try_query('SHOW MASTER LOGS', null, PMA_DBI_QUERY_STORE);
if ($binlogs) {
if (PMA_DBI_num_rows($binlogs) > 0) {
$binary_logs = array();
while ($row = PMA_DBI_fetch_array($binlogs)) {
$binary_logs[] = $row[0];
}
$has_binlogs = TRUE;
}
PMA_DBI_free_result($binlogs);
}
unset($binlogs);
/**
* @global array binary log files
*/
$binary_logs = PMA_DBI_fetch_result('SHOW MASTER LOGS', 'Log_name', null, null,
PMA_DBI_QUERY_STORE);
?>