Hi,
I'm Tomas Srnka, 18 years old and living in Slovakia. In next two
months, I will finish my high school (IBD programme).
I'm applying to Google Summer of Code 2009 for implementation of
replication into phpMyAdmin. Therefore, I have started studying
phpMyAdmin code by adding small new features.
This morning, I finished table, which displays information about master
status in "Server Status" section (see
http://toms.linuxos.sk/gsoc09/phpMyAdmin/ for screenshots). I'm sending
two patches, which bring the feature. Any comments are more than
welcomed :).
My plan is to create section with information about both master and
slave statuses at the beginning.
Best Regards,
Tomas Srnka
*** phpMyAdmin-dev-svn/phpMyAdmin-dev/lang/english-utf-8.inc.php 2009-04-05
11:45:16.000000000 +0200
--- phpMyAdmin-dev/lang/english-utf-8.inc.php 2009-04-05 12:10:27.000000000 +0200
***************
*** 718,723 ****
--- 718,726 ----
$strReplaceNULLBy = 'Replace NULL by';
$strReplaceTable = 'Replace table data with file';
$strReplication = 'Replication';
+ $strReplicationStatus = 'Replication Status';
+ $strReplicationMasterStatus = 'Master Status';
+ $strReplicationMasterStatusNotAvailable = 'This server does not work as master
server.';
$strReset = 'Reset';
$strResourceLimits = 'Resource limits';
$strRestartInsertion = 'Restart insertion with %s rows';
*** phpMyAdmin-dev-svn/phpMyAdmin-dev/server_status.php 2009-04-05 11:45:41.000000000
+0200
--- phpMyAdmin-dev/server_status.php 2009-04-05 13:05:26.000000000 +0200
***************
*** 64,76 ****
*/
$server_status = PMA_DBI_fetch_result('SHOW GLOBAL STATUS', 0, 1);
/**
* for some calculations we require also some server settings
*/
$server_variables = PMA_DBI_fetch_result('SHOW GLOBAL VARIABLES', 0, 1);
-
/**
* starttime calculation
*/
--- 64,80 ----
*/
$server_status = PMA_DBI_fetch_result('SHOW GLOBAL STATUS', 0, 1);
+ /**
+ * get master status from server
+ */
+ $server_master_status = PMA_DBI_fetch_result('SHOW MASTER STATUS');
+
/**
* for some calculations we require also some server settings
*/
$server_variables = PMA_DBI_fetch_result('SHOW GLOBAL VARIABLES', 0, 1);
/**
* starttime calculation
*/
***************
*** 460,465 ****
--- 464,524 ----
<hr class="clearfloat" />
+ <h3><?php echo $strReplicationStatus ?></h3>
+ <h4><?php echo $strReplicationMasterStatus ?></h4>
+ <?php
+ if (count($server_master_status)==0)
+ echo $strReplicationMasterStatusNotAvailable."<br />\n";
+ else {
+ ?>
+ <table id="serverstatusqueriessummary" class="data">
+
+ <thead>
+ <tr>
+ <th><?php echo $strVar;; ?></th>
+ <th><?php echo $strValue; ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr class="odd">
+ <td class="name">
+ File
+ </td>
+ <td class="value">
+ <?php echo $server_master_status[0]["File"]; ?>
+ </td>
+ </tr>
+ <tr class="even">
+ <td class="name">
+ Position
+ </td>
+ <td class="value">
+ <?php echo $server_master_status[0]["Position"]; ?>
+ </td>
+ </tr>
+ <tr class="odd">
+ <td class="name">
+ Binlog_Do_DB
+ </td>
+ <td class="value">
+ <?php echo $server_master_status[0]["Binlog_Do_DB"]; ?>
+ </td>
+ </tr>
+ <tr class="even">
+ <td class="name">
+ Binlog_Ignore_DB
+ </td>
+ <td class="value">
+ <?php echo $server_master_status[0]["Binlog_Ignore_DB"]; ?>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <?php
+ }
+ ?>
+ <hr class="clearfloat" />
+
<h3><?php echo
sprintf($strQueryStatistics,
PMA_formatNumber($server_status['Questions'], 0)); ?></h3>
***************
*** 674,679 ****
--- 733,739 ----
?>
</div>
</div>
+
<?php