Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Delisle <marc@infomarc.info>2009-10-12 15:57:04 +0400
committerMarc Delisle <marc@infomarc.info>2009-10-12 15:57:04 +0400
commit14645a503559e959a30287436d0fc48c727c0f79 (patch)
treea0d9322fabc7b58999710cf7508e02b3de585d13 /server_replication.php
parentd7ffee57e1d1e3499ee3f9163f4967d8b08e8066 (diff)
unneccesary connection to server
Diffstat (limited to 'server_replication.php')
-rw-r--r--server_replication.php16
1 files changed, 2 insertions, 14 deletions
diff --git a/server_replication.php b/server_replication.php
index 4b6369ccac..d57b1c7374 100644
--- a/server_replication.php
+++ b/server_replication.php
@@ -51,25 +51,13 @@ if (isset($GLOBALS['sr_take_action'])) {
$_SESSION['replication']['m_correct'] = '';
$_SESSION['replication']['sr_action_status'] = 'error';
$_SESSION['replication']['sr_action_info'] = $strReplicationUnknownError;
- $url = $sr['hostname'];
-
- if ($sr['port'] != '') {
- $url .= ':' . $sr['port'];
- }
-
// Attempt to connect to the new master server
- $check_master = null;
- $old_error_reporting = error_reporting(0);
- $check_master = @mysql_connect($url, $sr['username'], $sr['pma_pw']);
- error_reporting($old_error_reporting);
- unset($url);
+ $link_to_master = PMA_replication_connect_to_master($sr['username'], $sr['pma_pw'], $sr['hostname'], $sr['port']);
- if (!$check_master) {
+ if (! $link_to_master) {
$_SESSION['replication']['sr_action_status'] = 'error';
$_SESSION['replication']['sr_action_info'] = sprintf($GLOBALS['strReplicationErrorMasterConnect'], $sr['hostname']);
} else {
- $link_to_master = PMA_replication_connect_to_master($sr['username'], $sr['pma_pw'], $sr['hostname'], $sr['port']);
-
// Read the current master position
$position = PMA_replication_slave_bin_log_master($link_to_master);