diff --git a/ChangeLog b/ChangeLog index 175cea373..4ca4dc7b1 100755 --- a/ChangeLog +++ b/ChangeLog @@ -53,6 +53,8 @@ $Source$ phpMyAdmin one defined (bug #1312758). * tbl_properties_structure.php: Removed query box as discussed on mailing list. + * tbl_*: Use more require_once to avoid acquiring table info several + times. 2005-10-07 Marc Delisle * libraries/check_user_privileges.lib.php: bug #1313821, dbname containing a diff --git a/tbl_addfield.php b/tbl_addfield.php index aa76e2779..2642b35fb 100644 --- a/tbl_addfield.php +++ b/tbl_addfield.php @@ -210,18 +210,18 @@ if ($abort == FALSE) { /** * Gets tables informations */ - require('./tbl_properties_common.php'); - require('./tbl_properties_table_info.php'); + require_once('./tbl_properties_common.php'); + require_once('./tbl_properties_table_info.php'); /** * Displays top menu links */ $active_page = 'tbl_properties_structure.php'; - require('./tbl_properties_links.php'); + require_once('./tbl_properties_links.php'); /** * Display the form */ $action = 'tbl_addfield.php'; - require('./tbl_properties.inc.php'); + require_once('./tbl_properties.inc.php'); // Diplays the footer echo "\n"; diff --git a/tbl_alter.php b/tbl_alter.php index 61e53132a..90be2fce4 100644 --- a/tbl_alter.php +++ b/tbl_alter.php @@ -15,8 +15,8 @@ PMA_checkParameters(array('db', 'table')); /** * Gets tables informations */ -require('./tbl_properties_common.php'); -require('./tbl_properties_table_info.php'); +require_once('./tbl_properties_common.php'); +require_once('./tbl_properties_table_info.php'); /** * Displays top menu links */ diff --git a/tbl_change.php b/tbl_change.php index 052b9a510..053ac80c5 100644 --- a/tbl_change.php +++ b/tbl_change.php @@ -62,7 +62,7 @@ if (!preg_match('@^(db_details|tbl_properties|tbl_select)@', $goto)) { /** * Ensures db and table are valid, else moves to the "parent" script */ -require('./libraries/db_table_exists.lib.php'); +require_once('./libraries/db_table_exists.lib.php'); /** @@ -71,7 +71,7 @@ require('./libraries/db_table_exists.lib.php'); $url_query = PMA_generate_common_url($db, $table) . '&goto=tbl_properties.php'; -require('./tbl_properties_table_info.php'); +require_once('./tbl_properties_table_info.php'); /* Get comments */ @@ -91,7 +91,7 @@ if ($GLOBALS['cfg']['ShowPropertyComments']) { /** * Displays top menu links */ -require('./tbl_properties_links.php'); +require_once('./tbl_properties_links.php'); /** * Get the list of the fields of the current table diff --git a/tbl_import.php b/tbl_import.php index befc2ecf0..d2c230919 100644 --- a/tbl_import.php +++ b/tbl_import.php @@ -6,19 +6,19 @@ /** * Gets tables informations and displays top links */ -require('./tbl_properties_common.php'); -require('./tbl_properties_table_info.php'); +require_once('./tbl_properties_common.php'); +require_once('./tbl_properties_table_info.php'); /** * Displays top menu links */ -require('./tbl_properties_links.php'); +require_once('./tbl_properties_links.php'); $import_type = 'table'; -require('./libraries/display_import.lib.php'); +require_once('./libraries/display_import.lib.php'); /** * Displays the footer */ -require('./footer.inc.php'); +require_once('./footer.inc.php'); ?> diff --git a/tbl_properties.php b/tbl_properties.php index ef11dbccb..baa2c0358 100644 --- a/tbl_properties.php +++ b/tbl_properties.php @@ -6,8 +6,8 @@ /** * Runs common work */ -require './tbl_properties_common.php'; -require_once './libraries/sql_query_form.lib.php'; +require('./tbl_properties_common.php'); +require_once('./libraries/sql_query_form.lib.php'); $err_url = 'tbl_properties.php' . $err_url; $goto = 'tbl_properties.php'; @@ -16,12 +16,12 @@ $back = 'tbl_properties.php'; /** * Get table information */ -require './tbl_properties_table_info.php'; +require_once('./tbl_properties_table_info.php'); /** * Displays top menu links */ -require './tbl_properties_links.php'; +require_once('./tbl_properties_links.php'); /** * Query box, bookmark, insert data from textfile @@ -31,5 +31,5 @@ PMA_sqlQueryForm(); /** * Displays the footer */ -require_once './footer.inc.php'; +require_once('./footer.inc.php'); ?> diff --git a/tbl_properties_export.php b/tbl_properties_export.php index b3505d958..f34f1e273 100644 --- a/tbl_properties_export.php +++ b/tbl_properties_export.php @@ -6,9 +6,9 @@ /** * Gets tables informations and displays top links */ -require('./tbl_properties_common.php'); +require_once('./tbl_properties_common.php'); $url_query .= '&goto=tbl_properties_export.php&back=tbl_properties_export.php'; -require('./tbl_properties_table_info.php'); +require_once('./tbl_properties_table_info.php'); ?> diff --git a/tbl_properties_operations.php b/tbl_properties_operations.php index 0301fc920..1e7a334eb 100644 --- a/tbl_properties_operations.php +++ b/tbl_properties_operations.php @@ -77,12 +77,12 @@ if (isset($submitorderby) && !empty($order_field)) { /** * Gets tables informations */ -require('./tbl_properties_table_info.php'); +require_once('./tbl_properties_table_info.php'); /** * Displays top menu links */ -require('./tbl_properties_links.php'); +require_once('./tbl_properties_links.php'); /** * Get columns names diff --git a/tbl_properties_structure.php b/tbl_properties_structure.php index 60b50da28..fd365fc4a 100644 --- a/tbl_properties_structure.php +++ b/tbl_properties_structure.php @@ -35,7 +35,7 @@ if ((!empty($submit_mult) && isset($selected_fld)) /** * Runs common work */ -require('./tbl_properties_common.php'); +require_once('./tbl_properties_common.php'); $url_query .= '&goto=tbl_properties_structure.php&back=tbl_properties_structure.php'; /** @@ -45,7 +45,7 @@ $url_query .= '&goto=tbl_properties_structure.php&back=tbl_properties_st /** * Gets tables informations */ -require('./tbl_properties_table_info.php'); +require_once('./tbl_properties_table_info.php'); /** * Show result of multi submit operation @@ -58,7 +58,7 @@ if ((!empty($submit_mult) && isset($selected_fld)) /** * Displays top menu links */ -require('./tbl_properties_links.php'); +require_once('./tbl_properties_links.php'); // 2. Gets table keys and retains them $result = PMA_DBI_query('SHOW INDEX FROM ' . PMA_backquote($table) . ';'); diff --git a/tbl_relation.php b/tbl_relation.php index 50ad5611c..036fd69e8 100644 --- a/tbl_relation.php +++ b/tbl_relation.php @@ -14,7 +14,7 @@ $url_query .= '&goto=tbl_properties.php'; /** * Gets tables informations */ -require('./tbl_properties_table_info.php'); +require_once('./tbl_properties_table_info.php'); // Note: in tbl_properties_links.php we get and display the table comment. // For InnoDB, this comment contains the REFER information but any update @@ -24,7 +24,7 @@ $avoid_show_comment = TRUE; /** * Displays top menu links */ -require('./tbl_properties_links.php'); +require_once('./tbl_properties_links.php'); require_once('./libraries/relation.lib.php'); diff --git a/tbl_select.php b/tbl_select.php index a356fe0a2..bd926054e 100644 --- a/tbl_select.php +++ b/tbl_select.php @@ -35,19 +35,19 @@ if ($cfg['PropertiesIconic'] == true) { */ if (!isset($param) || $param[0] == '') { // Gets some core libraries - require('./tbl_properties_common.php'); + require_once('./tbl_properties_common.php'); //$err_url = 'tbl_select.php' . $err_url; $url_query .= '&goto=tbl_select.php&back=tbl_select.php'; /** * Gets tables informations */ - require('./tbl_properties_table_info.php'); + require_once('./tbl_properties_table_info.php'); /** * Displays top menu links */ - require('./tbl_properties_links.php'); + require_once('./tbl_properties_links.php'); if (!isset($goto)) { $goto = $cfg['DefaultTabTable'];