From a82cc85f04c8988a7c654a9df2798ed9693cb003 Mon Sep 17 00:00:00 2001 From: Herman van Rink Date: Tue, 9 Feb 2010 19:57:06 +0000 Subject: [PATCH] Code cleanup done during Fosdem2010 --- db_structure.php | 6 +++--- pmd_pdf.php | 25 +++++++++++++++---------- server_replication.php | 4 ++-- tbl_get_field.php | 2 +- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/db_structure.php b/db_structure.php index e5c300809..4bb986e44 100644 --- a/db_structure.php +++ b/db_structure.php @@ -350,8 +350,8 @@ foreach ($tables as $keyname => $each_table) { //////////////////////////////////////////////////////////////// if ((strlen(array_search($truename, $server_slave_Do_Table)) > 0) - || (strlen(array_search($db, $server_slave_Do_DB))>0) - || (count($server_slave_Do_DB)==1 && count($server_slave_Ignore_DB)==1) + || (strlen(array_search($db, $server_slave_Do_DB)) > 0) + || (count($server_slave_Do_DB) == 1 && count($server_slave_Ignore_DB) == 1) ) { $do = true; } @@ -360,7 +360,7 @@ foreach ($tables as $keyname => $each_table) { $do = true; } //////////////////////////////////////////////////////////////////// - if ((strlen(array_search($truename, $server_slave_Ignore_Table))>0) || (strlen(array_search($db, $server_slave_Ignore_DB))>0)) { + if ((strlen(array_search($truename, $server_slave_Ignore_Table)) > 0) || (strlen(array_search($db, $server_slave_Ignore_DB)) > 0)) { $ignored = true; } foreach ($server_slave_Wild_Ignore_Table as $table) { diff --git a/pmd_pdf.php b/pmd_pdf.php index 48cda9745..2ef21b35d 100644 --- a/pmd_pdf.php +++ b/pmd_pdf.php @@ -6,14 +6,16 @@ * @package phpMyAdmin-Designer */ -/** - * - */ include_once 'pmd_common.php'; + +/** + * If called directly from the designer, first save the positions + */ if (! isset($scale)) { $no_die_save_pos = 1; include_once 'pmd_save_pos.php'; } + require_once './libraries/relation.lib.php'; if (isset($scale) && ! isset($createpage)) { @@ -49,6 +51,7 @@ if (isset($scale) && ! isset($createpage)) { die(""); } + if (isset($createpage)) { /* * @see pdf_pages.php @@ -57,6 +60,7 @@ if (isset($createpage)) { $pdf_page_number = PMA_REL_create_page($newpage, $cfgRelation, $db, $query_default_option); } + // no need to use pmd/styles require_once './libraries/header_meta_style.inc.php'; ?> @@ -72,17 +76,18 @@ require_once './libraries/header_meta_style.inc.php';

-

: +

: - - + +

-
+
diff --git a/server_replication.php b/server_replication.php index afba58d56..5dd4212a7 100644 --- a/server_replication.php +++ b/server_replication.php @@ -40,7 +40,6 @@ if (! $is_superuser) { /** * Handling control requests */ - if (isset($GLOBALS['sr_take_action'])) { $refresh = false; if (isset($GLOBALS['slave_changemaster'])) { @@ -51,6 +50,7 @@ if (isset($GLOBALS['sr_take_action'])) { $_SESSION['replication']['m_correct'] = ''; $_SESSION['replication']['sr_action_status'] = 'error'; $_SESSION['replication']['sr_action_info'] = $strReplicationUnknownError; + // Attempt to connect to the new master server $link_to_master = PMA_replication_connect_to_master($sr['username'], $sr['pma_pw'], $sr['hostname'], $sr['port']); @@ -97,7 +97,7 @@ if (isset($GLOBALS['sr_take_action'])) { } elseif (isset($GLOBALS['sl_sync'])) { // TODO username, host and port could be read from 'show slave status', - // when asked for a password this might work in more situations the just after changing master (where the master password is stored in session) + // when asked for a password this might work in more situations then just after changing master (where the master password is stored in session) $src_link = PMA_replication_connect_to_master($_SESSION['replication']['m_username'], $_SESSION['replication']['m_password'], $_SESSION['replication']['m_hostname'], $_SESSION['replication']['m_port']); $trg_link = null; // using null to indicate the current PMA server diff --git a/tbl_get_field.php b/tbl_get_field.php index 34d88828a..01773c936 100644 --- a/tbl_get_field.php +++ b/tbl_get_field.php @@ -36,7 +36,7 @@ if ($result === false) { } /* Avoid corrupting data */ -@ini_set('url_rewriter.tags',''); +@ini_set('url_rewriter.tags', ''); header('Content-Type: ' . PMA_detectMIME($result)); header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');