';
}
/**
* This function prints out table with replication status.
*
* @param String type - either master or slave
* @param boolean $hidden - if true, then default style is set to hidden, default value false
* @param boolen $title - if true, then title is displayed, default true
*/
function PMA_replication_print_status_table($type, $hidden = false, $title = true) {
global ${"{$type}_variables"};
global ${"{$type}_variables_alerts"};
global ${"{$type}_variables_oks"};
global ${"server_{$type}_replication"};
global ${"strReplicationStatus_{$type}"};
// TODO check the Masters server id?
// seems to default to '1' when queried via SHOW VARIABLES , but resulted in error on the master when slave connects
// [ERROR] Error reading packet from server: Misconfigured master - server id was not set ( server_errno=1236)
// [ERROR] Got fatal error 1236: 'Misconfigured master - server id was not set' from master when reading data from binary log
//
//$server_id = PMA_DBI_fetch_value("SHOW VARIABLES LIKE 'server_id'", 0, 1);
echo '
';
// TODO change to regexp or something, to allow for negative match
if (isset(${"{$type}_variables_alerts"}[$variable])
&& ${"{$type}_variables_alerts"}[$variable] == ${"server_{$type}_replication"}[0][$variable]
) {
echo '';
} elseif (isset(${"{$type}_variables_oks"}[$variable])
&& ${"{$type}_variables_oks"}[$variable] == ${"server_{$type}_replication"}[0][$variable]
) {
echo '';
} else {
echo '';
}
echo ${"server_{$type}_replication"}[0][$variable];
echo '';
echo '
';
echo '
';
$odd_row = ! $odd_row;
}
echo ' ';
echo '
';
echo ' ';
echo '
';
}
/**
* Prints table with slave users connected to this master
*
* @param boolean $hidden - if true, then default style is set to hidden, default value false
*/
function PMA_replication_print_slaves_table($hidden = false) {
// Fetch data
$data = PMA_DBI_fetch_result('SHOW SLAVE HOSTS', null, null);
echo ' ';
echo '