From 97ff371cb586ae997d517b20579df53c8040233e Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 5 Dec 2009 12:37:27 +0000 Subject: [PATCH] code cleanup --- import_status.php | 17 ++-- server_replication.php | 174 ++++++++++++++++++++--------------------- 2 files changed, 96 insertions(+), 95 deletions(-) diff --git a/import_status.php b/import_status.php index fa148f06e..93cd7ba00 100644 --- a/import_status.php +++ b/import_status.php @@ -16,17 +16,18 @@ header("Expires: Sat, 11 Jan 1991 06:30:00 GMT"); // Date in the past // $GLOBALS["message"] is used for asking for an import message if (isset($GLOBALS["message"]) && $GLOBALS["message"]) { - header('Content-type: text/html'); + header('Content-type: text/html'); - while ($_SESSION['Import_message']['message']==null) // wait until message is available - usleep(250000); // 0.25 sec + while ($_SESSION['Import_message']['message'] == null) { // wait until message is available + usleep(250000); // 0.25 sec + } - echo $_SESSION['Import_message']['message']; - echo '
'."\n"; - echo ' [ '.$GLOBALS["strBack"].' ]' ."\n"; - echo '
'."\n"; + echo $_SESSION['Import_message']['message']; + echo '
' . "\n"; + echo ' [ ' . $GLOBALS["strBack"] . ' ]' . "\n"; + echo '
'."\n"; } else { - PMA_importAjaxStatus($GLOBALS["id"]); + PMA_importAjaxStatus($GLOBALS["id"]); } ?> diff --git a/server_replication.php b/server_replication.php index d57b1c737..13124bac0 100644 --- a/server_replication.php +++ b/server_replication.php @@ -27,7 +27,7 @@ require_once './libraries/server_synchronize.lib.php'; /** * Checks if the user is allowed to do what he tries to... */ -if (!$is_superuser) { +if (! $is_superuser) { require './libraries/server_links.inc.php'; echo '

' . "\n" . PMA_getIcon('s_replication.png') @@ -67,7 +67,7 @@ if (isset($GLOBALS['sr_take_action'])) { } else { $_SESSION['replication']['m_correct'] = true; - if (!PMA_replication_slave_change_master($sr['username'], $sr['pma_pw'], $sr['hostname'], $sr['port'], $position, true, false)) { + if (! PMA_replication_slave_change_master($sr['username'], $sr['pma_pw'], $sr['hostname'], $sr['port'], $position, true, false)) { $_SESSION['replication']['sr_action_status'] = 'error'; $_SESSION['replication']['sr_action_info'] = $GLOBALS['strReplicationUnableToChange']; } else { @@ -107,10 +107,10 @@ if (isset($GLOBALS['sr_take_action'])) { $ignore_db = array(); $dblist = array(); - if (!empty($data[0]['Binlog_Do_DB'])) { + if (! empty($data[0]['Binlog_Do_DB'])) { $do_db = explode(',', $data[0]['Binlog_Do_DB']); } - if (!empty($data[0]['Binlog_Ignore_DB'])) { + if (! empty($data[0]['Binlog_Ignore_DB'])) { $ignore_db = explode(',', $data[0]['Binlog_Ignore_DB']); } @@ -159,11 +159,11 @@ if (isset($GLOBALS['sr_take_action'])) { */ require './libraries/server_links.inc.php'; -echo '
'."\n"; -echo '

'."\n"; -echo ' '."\n"; -echo $GLOBALS['strReplication']."\n"; -echo '

'."\n"; +echo '
'; +echo '

'; +echo ' '; +echo $GLOBALS['strReplication']; +echo '

'; // Display error messages if (isset($_SESSION['replication']['sr_action_status']) && isset($_SESSION['replication']['sr_action_info'])) { @@ -177,66 +177,66 @@ if (isset($_SESSION['replication']['sr_action_status']) && isset($_SESSION['repl } if ($server_master_status) { - if (!isset($GLOBALS['repl_clear_scr'])) { + if (! isset($GLOBALS['repl_clear_scr'])) { echo PMA_js_mootools_domready($jscode['master_replication']); - echo '
'."\n"; - echo ''. $GLOBALS['strReplicationMaster'] .''."\n"; - echo $GLOBALS['strReplicationConfiguredMaster']."\n"; - echo '"; + echo "
"; } -} elseif (!isset($GLOBALS['mr_configure']) && !isset($GLOBALS['repl_clear_scr'])) { +} elseif (! isset($GLOBALS['mr_configure']) && ! isset($GLOBALS['repl_clear_scr'])) { $_url_params = $GLOBALS['url_params']; $_url_params['mr_configure'] = true; - echo '
'."\n"; - echo ''. $GLOBALS['strReplicationMaster'] .''."\n"; - echo sprintf($GLOBALS['strReplicationServernConfiguredMaster'], PMA_generate_common_url($_url_params)) ."\n"; - echo '
'."\n"; + echo '
'; + echo '' . $GLOBALS['strReplicationMaster'] . ''; + echo sprintf($GLOBALS['strReplicationServernConfiguredMaster'], PMA_generate_common_url($_url_params)); + echo '
'; } if (isset($GLOBALS['mr_configure'])) { // Render the 'Master configuration' section echo PMA_js_mootools_domready($jscode['configure_master']); - echo '
'."\n"; - echo ''. $GLOBALS['strReplicationMasterConfiguration'] .''."\n"; - echo $GLOBALS['strReplicationMasterChooseMode'].'

'."\n"; + echo '
'; + echo '' . $GLOBALS['strReplicationMasterConfiguration'] . ''; + echo $GLOBALS['strReplicationMasterChooseMode'] . '

'; - echo ''."\n"; - echo '

'."\n"; - echo $GLOBALS['strReplicationSelectDatabases'].'
'."\n"; + echo ''; + echo '

'; + echo $GLOBALS['strReplicationSelectDatabases'] . '
'; echo PMA_replication_db_multibox(); - echo '

'."\n"; - echo $GLOBALS['strReplicationAddLines'].'
'."\n"; - echo '
server-id='. $serverid .'
log-bin=mysql-bin
log-error=mysql-bin.err
'."\n"; - echo $GLOBALS['strReplicationRestartServer'] ."\n"; - echo '
'."\n"; + echo '

'; + echo $GLOBALS['strReplicationAddLines'] . '
'; + echo '
server-id='. $serverid . '
log-bin=mysql-bin
log-error=mysql-bin.err
'; + echo $GLOBALS['strReplicationRestartServer']; + echo '
'; echo '
'; - echo '
'."\n"; + echo ' '; echo PMA_generate_common_hidden_inputs('', ''); echo ' '; - echo '
'."\n"; + echo ' '; echo '
'; require_once './libraries/footer.inc.php'; @@ -245,13 +245,13 @@ if (isset($GLOBALS['mr_configure'])) { echo '
'; -if (!isset($GLOBALS['repl_clear_scr'])) { +if (! isset($GLOBALS['repl_clear_scr'])) { // Render the 'Slave configuration' section - echo '
'."\n"; - echo '' . $GLOBALS['strReplicationSlave'] . ''."\n"; + echo '
'; + echo '' . $GLOBALS['strReplicationSlave'] . ''; if ($server_slave_status) { echo PMA_js_mootools_domready($jscode['slave_control']); - echo '
'."\n"; + echo '
'; $_url_params = $GLOBALS['url_params']; $_url_params['sr_take_action'] = true; @@ -304,61 +304,61 @@ if (!isset($GLOBALS['repl_clear_scr'])) { $reconfiguremaster_link = PMA_generate_common_url($_url_params); - echo $GLOBALS['strReplicationSlaveConfigured']."\n"; - echo '
'."\n"; - echo ''; + echo '
'; + echo ' '; + echo '
  • ' . $GLOBALS['strReplicationSlaveChangeMaster'] . '
  • '; + echo ''; - } elseif (!isset($GLOBALS['sl_configure'])) { + } elseif (! isset($GLOBALS['sl_configure'])) { $_url_params = $GLOBALS['url_params']; $_url_params['sl_configure'] = true; $_url_params['repl_clear_scr'] = true; - echo sprintf($GLOBALS['strReplicationSlaveNotConfigured'], PMA_generate_common_url($_url_params))."\n"; + echo sprintf($GLOBALS['strReplicationSlaveNotConfigured'], PMA_generate_common_url($_url_params)); } - echo '
    '."\n"; - echo '
    '."\n"; + echo '
    '; + echo ''; } if (isset($GLOBALS['sl_configure'])) { PMA_replication_gui_changemaster("slave_changemaster");