Skip to content
Browse files

Huge set of optimizations, please test!

  • Loading branch information...
1 parent 0500480 commit 37d50c1822c9b3b8d8bd1f5cb5c8a5e74ee1d268 @derrabus derrabus committed Nov 26, 2003
Showing with 8,615 additions and 8,769 deletions.
  1. +19 −2 ChangeLog
  2. +7 −9 browse_foreigners.php
  3. +6 −7 chk_rel.php
  4. +0 −4 config.inc.php
  5. +3 −3 css/phpmyadmin.css.php
  6. +5 −7 db_create.php
  7. +6 −6 db_datadict.php
  8. +4 −4 db_details.php
  9. +6 −12 db_details_common.php
  10. +2 −4 db_details_db_info.php
  11. +7 −8 db_details_export.php
  12. +19 −19 db_details_importdocsql.php
  13. +8 −8 db_details_qbe.php
  14. +13 −17 db_details_structure.php
  15. +10 −13 db_printview.php
  16. +2 −2 db_search.php
  17. +31 −32 export.php
  18. +17 −6 footer.inc.php
  19. +136 −143 header.inc.php
  20. +4 −4 header_printview.inc.php
  21. +4 −4 index.php
  22. +8 −8 ldi_check.php
  23. +5 −7 ldi_table.php
  24. +27 −27 left.php
  25. +79 −83 libraries/auth/config.auth.lib.php
  26. +447 −453 libraries/auth/cookie.auth.lib.php
  27. +197 −201 libraries/auth/http.auth.lib.php
  28. +154 −160 libraries/bookmark.lib.php
  29. +246 −269 libraries/charset_conversion.lib.php
  30. +1,680 −1,698 libraries/common.lib.php
  31. +1,165 −1,169 libraries/config_import.lib.php
  32. +73 −76 libraries/db_config.lib.php
  33. +3 −3 libraries/db_table_exists.lib.php
  34. +64 −68 libraries/dbg/profiling.php
  35. +13 −17 libraries/dbg/setup.php
  36. +116 −32 libraries/defines.lib.php
  37. +40 −0 libraries/defines_mysql.lib.php
  38. +0 −132 libraries/defines_php.lib.php
  39. +1 −1 libraries/display_export.lib.php
  40. +1,659 −1,663 libraries/display_tbl.lib.php
  41. +17 −17 libraries/display_tbl_links.lib.php
  42. +37 −41 libraries/get_foreign.lib.php
  43. +47 −49 libraries/grab_globals.lib.php
  44. +255 −259 libraries/ip_allow_deny.lib.php
  45. +135 −138 libraries/kanji-encoding.lib.php
  46. +5 −8 libraries/mysql_charsets.lib.php
  47. +121 −127 libraries/mysql_wrappers.lib.php
  48. +117 −120 libraries/ob.lib.php
  49. +180 −184 libraries/read_dump.lib.php
  50. +591 −595 libraries/relation.lib.php
  51. +111 −115 libraries/relation_cleanup.lib.php
  52. +230 −248 libraries/select_lang.lib.php
  53. +483 −487 libraries/sqlparser.data.php
Sorry, we could not display the entire diff because it was too big.
View
21 ChangeLog
@@ -5,17 +5,34 @@ phpMyAdmin - Changelog
$Id$
$Source$
+2003-11-26 Alexander M. Turek <lifeforrent@derrabus.de>
+ * Almost every file:
+ - Replaced all include / require commands by require_once where possible;
+ - Further php 4.1+ optimizations;
+ - footer.inc.php now automatically stops the script execution;
+ - Coding standards.
+ * config.inc.php: Don't include select_lang.lib.php here.
+ * libraries/common.lib.php, libraries/defines.lib.php,
+ libraries/defines_php.lib.php, libraries/defines_mysql.lib.php,
+ scripts/create-release.sh:
+ defines.lib.php was included twice. For optimization reasons I moved all
+ the code that is independent from the MySQL connection out of defines.lib
+ into defines_php.lib.
+ To point out the (new) meanings of the files I renamed defines.lib.php to
+ defines_mysql.lib.php while defines_php.lib.php is now known as
+ defines.lib.php.
+
2003-11-26 Michal Cihar <cleanerfasterbetter@cihar.com>
* lang/check_lang.sh: Cleanup.
* lang/sort_lang.sh: Cleanup.
* lang/czech: Better translated some strings.
-
+
2003-11-26 Marc Delisle <lem9@users.sourceforge.net>
* lang/arabic: update, thanks to Ossama Khayat (okhayat)
* lang/hindi: update, thanks to Girish Nair (girish_nair)
* lang/slovak: Updated, thanks to Lubos Klokner (erkac).
* lang/spanish: Updated, thanks to Daniel Hinostroza (hinostroza).
-
+
2003-11-25 Alexander M. Turek <jaggedlittlepill@derrabus.de>
* translators.html: Changed email of Hindi translator, again.
* badwords.txt: File is obsolete.
View
16 browse_foreigners.php
@@ -5,25 +5,23 @@
/**
* Get the variables sent or posted to this script and displays the header
*/
-require('./libraries/grab_globals.lib.php');
+require_once('./libraries/grab_globals.lib.php');
/**
* Gets a core script and starts output buffering work
*/
-if (!defined('PMA_COMMON_LIB_INCLUDED')) {
- include('./libraries/common.lib.php');
-}
+require_once('./libraries/common.lib.php');
PMA_checkParameters(array('db', 'table', 'field'));
-require('./libraries/ob.lib.php');
+require_once('./libraries/ob.lib.php');
if ($cfg['OBGzip']) {
$ob_mode = PMA_outBufferModeGet();
if ($ob_mode) {
PMA_outBufferPre($ob_mode);
}
}
-include('./libraries/header_http.inc.php');
+require_once('./libraries/header_http.inc.php');
$field = urldecode($field);
/**
@@ -58,8 +56,8 @@ function formupdate(field, key) {
<body bgcolor="<?php echo $cfg['LeftBgColor']; ?>" style="margin-left: 5px; margin-top: 5px; margin-right: 5px; margin-bottom: 0px">
<?php
$per_page = 200;
-require('./libraries/relation.lib.php'); // foreign keys
-require('./libraries/transformations.lib.php'); // Transformations
+require_once('./libraries/relation.lib.php'); // foreign keys
+require_once('./libraries/transformations.lib.php'); // Transformations
$cfgRelation = PMA_getRelationsParam();
$foreigners = ($cfgRelation['relwork'] ? PMA_getForeigners($db, $table) : FALSE);
@@ -74,7 +72,7 @@ function formupdate(field, key) {
unset($foreign_limit);
}
-include('./libraries/get_foreign.lib.php');
+require('./libraries/get_foreign.lib.php');
?>
<form action="browse_foreigners.php" method="post">
View
13 chk_rel.php
@@ -6,10 +6,10 @@
/**
* Gets some core libraries
*/
-require('./libraries/grab_globals.lib.php');
-require('./libraries/common.lib.php');
-require('./db_details_common.php');
-require('./libraries/relation.lib.php');
+require_once('./libraries/grab_globals.lib.php');
+require_once('./libraries/common.lib.php');
+require_once('./db_details_common.php');
+require_once('./libraries/relation.lib.php');
/**
@@ -21,6 +21,5 @@
/**
* Displays the footer
*/
-echo "\n";
-require('./footer.inc.php');
-?>
+require_once('./footer.inc.php');
+?>
View
4 config.inc.php
@@ -434,10 +434,6 @@
'SHIFT_JIS'
);
-// Loads language file
-require('./libraries/select_lang.lib.php');
-
-
/**
* Customization & design
*/
View
6 css/phpmyadmin.css.php
@@ -4,16 +4,16 @@
chdir('..');
$is_minimum_common = TRUE;
-require('./libraries/grab_globals.lib.php');
-require('./libraries/common.lib.php');
+require_once('./libraries/grab_globals.lib.php');
+require_once('./libraries/common.lib.php');
// Gets the default font sizes
// garvin: TODO: Should be optimized to not include the whole common.lib.php bunch
// but only functions used to determine browser heritage.
PMA_setFontSizes();
$ctype = 'css';
-require('./libraries/header_http.inc.php');
+require_once('./libraries/header_http.inc.php');
if (!isset($js_frame)) {
$js_frame = 'left';
View
12 db_create.php
@@ -6,13 +6,11 @@
/**
* Gets some core libraries
*/
-require('./libraries/grab_globals.lib.php');
+require_once('./libraries/grab_globals.lib.php');
$js_to_run = 'functions.js';
-require('./header.inc.php');
+require_once('./header.inc.php');
+require_once('./libraries/common.lib.php');
-if (!defined('PMA_COMMON_LIB_INCLUDED')) {
- include('./libraries/common.lib.php');
-}
PMA_checkParameters(array('db'));
@@ -32,6 +30,6 @@
* Displays the result and calls default page
*/
$message = $strDatabase . ' ' . htmlspecialchars($db) . ' ' . $strHasBeenCreated;
-require('./' . $cfg['DefaultTabDatabase']);
+require_once('./' . $cfg['DefaultTabDatabase']);
-?>
+?>
View
12 db_datadict.php
@@ -6,16 +6,16 @@
* Gets the variables sent or posted to this script, then displays headers
*/
if (!isset($selected_tbl)) {
- include('./libraries/grab_globals.lib.php');
- include('./header.inc.php');
+ require_once('./libraries/grab_globals.lib.php');
+ require_once('./header.inc.php');
}
/**
* Gets the relations settings
*/
-require('./libraries/relation.lib.php');
-require('./libraries/transformations.lib.php');
+require_once('./libraries/relation.lib.php');
+require_once('./libraries/transformations.lib.php');
$cfgRelation = PMA_getRelationsParam();
@@ -317,5 +317,5 @@ function printPage()
<?php
echo '<br /><br />&nbsp;<input type="button" style="visibility: ; width: 100px; height: 25px" name="print" value="' . $strPrint . '" onclick="printPage()">' . "\n";
-require('./footer.inc.php');
-?>
+require_once('./footer.inc.php');
+?>
View
8 db_details.php
@@ -35,7 +35,7 @@
require('./db_details_db_info.php');
if ($num_tables == 0 && empty($db_query_force)) {
$is_info = TRUE;
- include('./db_details_structure.php');
+ require('./db_details_structure.php');
exit();
}
@@ -62,7 +62,7 @@
<?php echo sprintf($strRunSQLQuery, htmlspecialchars($db)) . ' ' . PMA_showMySQLDocu('Reference', 'SELECT'); ?>&nbsp;:<br />
<div style="margin-bottom: 5px">
<textarea name="sql_query" cols="<?php echo $cfg['TextareaCols'] * 2; ?>" rows="<?php echo $cfg['TextareaRows']; ?>" wrap="virtual" dir="<?php echo $text_dir; ?>"<?php echo $auto_sel; ?>>
-<?php
+<?php
if (!empty($query_to_display)) {
echo htmlspecialchars($query_to_display);
} else {
@@ -200,5 +200,5 @@
* Displays the footer
*/
echo "\n";
-require('./footer.inc.php');
-?>
+require_once('./footer.inc.php');
+?>
View
18 db_details_common.php
@@ -5,15 +5,9 @@
/**
* Gets some core libraries
*/
-if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
- include('./libraries/grab_globals.lib.php');
-}
-if (!defined('PMA_COMMON_LIB_INCLUDED')) {
- include('./libraries/common.lib.php');
-}
-if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
- include('./libraries/bookmark.lib.php');
-}
+require_once('./libraries/grab_globals.lib.php');
+require_once('./libraries/common.lib.php');
+require_once('./libraries/bookmark.lib.php');
PMA_checkParameters(array('db'));
@@ -35,13 +29,13 @@
}
if (empty($db) || !$is_db) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php?' . PMA_generate_common_url('', '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
- exit();
+ exit;
}
} // end if (ensures db exists)
// Displays headers
if (!isset($message)) {
$js_to_run = 'functions.js';
- include('./header.inc.php');
+ require_once('./header.inc.php');
// Reloads the navigation frame via JavaScript if required
if (isset($reload) && $reload) {
echo "\n";
@@ -63,4 +57,4 @@
*/
$url_query = PMA_generate_common_url($db);
-?>
+?>
View
6 db_details_db_info.php
@@ -5,9 +5,7 @@
// Check parameters
-if (!defined('PMA_COMMON_LIB_INCLUDED')) {
- include('./libraries/common.lib.php');
-}
+require_once('./libraries/common.lib.php');
PMA_checkParameters(array('db'));
@@ -70,4 +68,4 @@
echo '<!-- Top menu links -->' . "\n";
require('./db_details_links.php');
-?>
+?>
View
15 db_details_export.php
@@ -25,7 +25,7 @@
$multi_values = '<div align="center"><select name="table_select[]" size="6" multiple="multiple">';
$multi_values .= "\n";
-
+
$i = 0;
while ($i < $num_tables) {
$table = $tables[$i]['Name'];
@@ -41,26 +41,25 @@
$multi_values .= "\n";
$multi_values .= '</select></div>';
- $checkall_url = 'db_details_export.php?'
+ $checkall_url = 'db_details_export.php?'
. PMA_generate_common_url($db)
. '&amp;goto=db_details_export.php';
-
+
$multi_values .= '<br />
<a href="' . $checkall_url . '&amp;selectall=1" onclick="setSelectOptions(\'dump\', \'table_select[]\', true); return false;">' . $strSelectAll . '</a>
&nbsp;/&nbsp;
<a href="' . $checkall_url . '" onclick="setSelectOptions(\'dump\', \'table_select[]\', false); return false;">' . $strUnselectAll . '</a>
<br /><br />';
} elseif ($num_tables == 0) {
echo $strDatabaseNoTable;
- include('./footer.inc.php');
- exit;
+ require_once('./footer.inc.php');
} // end if
$export_type = 'database';
-require('./libraries/display_export.lib.php');
+require_once('./libraries/display_export.lib.php');
/**
* Displays the footer
*/
-require('./footer.inc.php');
-?>
+require_once('./footer.inc.php');
+?>
View
38 db_details_importdocsql.php
@@ -12,13 +12,13 @@
* Get the values of the variables posted or sent to this script and display
* the headers
*/
-require('./libraries/read_dump.lib.php');
-require('./libraries/grab_globals.lib.php');
-require('./header.inc.php');
+require_once('./libraries/read_dump.lib.php');
+require_once('./libraries/grab_globals.lib.php');
+require_once('./header.inc.php');
//require common added for string importing - Robbat2, 15 January 2003 9.34PM
//all hardcoded strings converted by Robbat2, 15 January 2003 9.34PM
-require('./libraries/common.lib.php');
+require_once('./libraries/common.lib.php');
// Check parameters
PMA_checkParameters(array('db'));
@@ -62,7 +62,7 @@ function docsql_check($docpath = '', $file = '', $filename = '', $content = 'non
$content = str_replace("\r", "\n", $content);
$lines = explode("\n", $content);
}
-
+
if (isset($lines) && is_array($lines) && count($lines) > 0) {
foreach($lines AS $lkey => $line) {
//echo '<p>' . $line . '</p>';
@@ -105,7 +105,7 @@ function docsql_check($docpath = '', $file = '', $filename = '', $content = 'non
} else {
echo '<p><font color="red">' . $GLOBALS['strFileCouldNotBeRead'] . '</font></p>' . "\n";
}
-
+
return 1;
} else {
if ($content != 'none') {
@@ -142,13 +142,13 @@ function docsql_check($docpath = '', $file = '', $filename = '', $content = 'non
*/
if (isset($do) && $do == 'import') {
$orig_docpath = $docpath;
-
+
if (empty($sql_file)) {
$sql_file = 'none';
}
// Get relation settings
- include('./libraries/relation.lib.php');
+ require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam();
// Gets the query from a file if required
@@ -157,15 +157,15 @@ function docsql_check($docpath = '', $file = '', $filename = '', $content = 'non
&& is_uploaded_file($sql_file)) {
$open_basedir = @ini_get('open_basedir');
-
+
// If we are on a server with open_basedir, we must move the file
// before opening it. The doc explains how to create the "./tmp"
// directory
-
+
if (!empty($open_basedir)) {
-
+
$tmp_subdir = (PMA_IS_WINDOWS ? '.\\tmp\\' : './tmp/');
-
+
// function is_writeable() is valid on PHP3 and 4
if (!is_writeable($tmp_subdir)) {
$docsql_text = PMA_readFile($sql_file, $sql_file_compression);
@@ -185,29 +185,29 @@ function docsql_check($docpath = '', $file = '', $filename = '', $content = 'non
// read from the normal upload dir
$docsql_text = PMA_readFile($sql_file, $sql_file_compression);
}
-
+
// Convert the file's charset if necessary
if ($cfg['AllowAnywhereRecoding'] && $allow_recoding
&& isset($charset_of_file) && $charset_of_file != $charset) {
$docsql_text = PMA_convert_string($charset_of_file, $charset, $docsql_text);
}
-
+
if (!isset($docsql_text) || $docsql_text == FALSE || $docsql_text == '') {
echo '<p><font color="red">' . $GLOBALS['strFileCouldNotBeRead'] . '</font></p>' . "\n";
} else {
docsql_check('', $sql_file_name, $sql_file_name, $docsql_text);
}
} // end uploaded file stuff
} else {
-
+
// echo '<h1>Starting Import</h1>';
$docpath = $cfg['docSQLDir'] . preg_replace('@\.\.*@', '.', $docpath);
if (substr($docpath, -1) != '/') {
$docpath .= '/';
}
-
+
$matched_files = 0;
-
+
if (is_dir($docpath)) {
// Do the work
$handle = opendir($docpath);
@@ -299,6 +299,6 @@ function docsql_check($docpath = '', $file = '', $filename = '', $content = 'non
* Displays the footer
*/
echo "\n";
-require('./footer.inc.php');
+require_once('./footer.inc.php');
-?>
+?>
View
16 db_details_qbe.php
@@ -7,9 +7,9 @@
* Get the values of the variables posted or sent to this script and display
* the headers
*/
-require('./libraries/grab_globals.lib.php');
-require('./libraries/common.lib.php');
-require('./libraries/relation.lib.php');
+require_once('./libraries/grab_globals.lib.php');
+require_once('./libraries/common.lib.php');
+require_once('./libraries/relation.lib.php');
/**
@@ -25,13 +25,13 @@
$goto = 'db_details.php';
$zero_rows = htmlspecialchars($strSuccess);
$sql_query = urldecode($encoded_sql_query);
- include('./sql.php');
+ require('./sql.php');
exit();
} else {
$sub_part = '_qbe';
- include('./db_details_common.php');
+ require('./db_details_common.php');
$url_query .= '&amp;goto=db_details_qbe.php';
- include('./db_details_db_info.php');
+ require('./db_details_db_info.php');
}
if (isset($submit_sql) && !preg_match('@^SELECT@i', $encoded_sql_query)) {
@@ -1076,5 +1076,5 @@ function PMA_getRelatives($from) {
/**
* Displays the footer
*/
-require('./footer.inc.php');
-?>
+require_once('./footer.inc.php');
+?>
View
30 db_details_structure.php
@@ -8,26 +8,22 @@
* because there is no table in the database ($is_info is TRUE)
*/
if (empty($is_info)) {
- if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
- include('./libraries/grab_globals.lib.php');
- }
- if (!defined('PMA_COMMON_LIB_INCLUDED')) {
- include('./libraries/common.lib.php');
- }
+ require_once('./libraries/grab_globals.lib.php');
+ require_once('./libraries/common.lib.php');
// Drops/deletes/etc. multiple tables if required
if ((!empty($submit_mult) && isset($selected_tbl))
|| isset($mult_btn)) {
$action = 'db_details_structure.php';
$err_url = 'db_details_structure.php?'. PMA_generate_common_url($db);
- include('./mult_submits.inc.php');
+ require('./mult_submits.inc.php');
}
- include('./db_details_common.php');
+ require('./db_details_common.php');
$url_query .= '&amp;goto=db_details_structure.php';
// Gets the database structure
$sub_part = '_structure';
- include('./db_details_db_info.php');
+ require('./db_details_db_info.php');
echo "\n";
/**
@@ -82,7 +78,7 @@ function pma_TableHeader($alternate = FALSE) {
/**
* Settings for relations stuff
*/
-require('./libraries/relation.lib.php');
+require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam();
/**
@@ -201,7 +197,7 @@ function pma_TableHeader($alternate = FALSE) {
<td valign="top">
<?php
}
-
+
pma_TableHeader();
$i = $sum_entries = 0;
@@ -251,9 +247,9 @@ function pma_TableHeader($alternate = FALSE) {
</td>
<td align="center" bgcolor="<?php echo $bgcolor; ?>">
<?php
- include('./libraries/bookmark.lib.php');
+ require_once('./libraries/bookmark.lib.php');
$book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label');
-
+
if (!empty($sts_data['Rows'])) {
echo '<a href="sql.php?' . $tbl_url_query . '&amp;sql_query='
. (isset($book_sql_query) && $book_sql_query != FALSE ? urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table)))
@@ -322,7 +318,7 @@ function pma_TableHeader($alternate = FALSE) {
$sum_size += $tblsize;
list($formated_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0);
if (isset($sts_data['Data_free']) && $sts_data['Data_free'] > 0) {
- list($formated_overhead, $overhead_unit) = PMA_formatByteDown($sts_data['Data_free']);
+ list($formated_overhead, $overhead_unit) = PMA_formatByteDown($sts_data['Data_free']);
$overhead_size += $sts_data['Data_free'];
}
}
@@ -388,7 +384,7 @@ function pma_TableHeader($alternate = FALSE) {
</td>
<?php
}
-
+
if ($cfg['ShowStats']) {
echo "\n";
?>
@@ -398,7 +394,7 @@ function pma_TableHeader($alternate = FALSE) {
</td>
<td align="right" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap">
&nbsp;&nbsp;
- <?php
+ <?php
if (isset($formated_overhead)) {
echo '<a href="tbl_properties_structure.php?' . $tbl_url_query . '#showusage">' . $formated_overhead . ' ' . $overhead_unit . '</a>' . "\n";
unset($formated_overhead);
@@ -692,5 +688,5 @@ function pma_TableHeader($alternate = FALSE) {
* Displays the footer
*/
echo "\n";
-require('./footer.inc.php');
+require_once('./footer.inc.php');
?>
View
23 db_printview.php
@@ -6,14 +6,11 @@
/**
* Gets the variables sent or posted to this script, then displays headers
*/
-require('./libraries/grab_globals.lib.php');
-require('./header.inc.php');
+require_once('./libraries/grab_globals.lib.php');
+require_once('./header.inc.php');
// Check parameters
-
-if (!defined('PMA_COMMON_LIB_INCLUDED')) {
- include('./libraries/common.lib.php');
-}
+require_once('./libraries/common.lib.php');
PMA_checkParameters(array('db'));
@@ -25,7 +22,7 @@
/**
* Settings for relations stuff
*/
-require('./libraries/relation.lib.php');
+require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam();
/**
@@ -210,15 +207,15 @@
} else {
$needs_break = '';
}
-
+
if ((isset($sts_data['Create_time']) && !empty($sts_data['Create_time']))
|| (isset($sts_data['Update_time']) && !empty($sts_data['Update_time']))
|| (isset($sts_data['Check_time']) && !empty($sts_data['Check_time']))) {
echo $needs_break;
?>
<table border="0" cellpadding="1" cellspacing="1" width="100%">
<?php
-
+
if (isset($sts_data['Create_time']) && !empty($sts_data['Create_time'])) {
?>
<tr>
@@ -227,7 +224,7 @@
</tr>
<?php
}
-
+
if (isset($sts_data['Update_time']) && !empty($sts_data['Update_time'])) {
?>
<tr>
@@ -236,7 +233,7 @@
</tr>
<?php
}
-
+
if (isset($sts_data['Check_time']) && !empty($sts_data['Check_time'])) {
?>
<tr>
@@ -308,5 +305,5 @@ function printPage()
<?php
echo '<br /><br />&nbsp;<input type="button" style="visibility: ; width: 100px; height: 25px" name="print" value="' . $strPrint . '" onclick="printPage()">' . "\n";
-require('./footer.inc.php');
-?>
+require_once('./footer.inc.php');
+?>
View
4 db_search.php
@@ -379,5 +379,5 @@ function PMA_getSearchSqls($table, $search_str, $search_option)
* Displays the footer
*/
echo "\n";
-require('./footer.inc.php');
-?>
+require_once('./footer.inc.php');
+?>
View
63 export.php
@@ -5,9 +5,9 @@
/**
* Get the variables sent or posted to this script and a core script
*/
-require('./libraries/grab_globals.lib.php');
-require('./libraries/common.lib.php');
-require('./libraries/zip.lib.php');
+require_once('./libraries/grab_globals.lib.php');
+require_once('./libraries/common.lib.php');
+require_once('./libraries/zip.lib.php');
PMA_checkParameters(array('what'));
@@ -68,7 +68,7 @@ function PMA_exportOutputHandler($line)
if ($GLOBALS['onfly_compression']) {
$dump_buffer_len += strlen($dump_buffer);
-
+
if ($dump_buffer_len > $GLOBALS['memory_limit']) {
// as bzipped
if ($GLOBALS['output_charset_conversion']) {
@@ -149,7 +149,7 @@ function PMA_exportOutputHandler($line)
$crlf = PMA_whichCrlf();
// Do we need to convert charset?
-$output_charset_conversion = $asfile &&
+$output_charset_conversion = $asfile &&
$cfg['AllowAnywhereRecoding'] && $allow_recoding
&& isset($charset_of_file) && $charset_of_file != $charset;
@@ -182,22 +182,22 @@ function PMA_exportOutputHandler($line)
$pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']);
if ($export_type == 'server') {
if (isset($remember_template)) {
- setcookie('pma_server_filename_template', $filename_template , 0,
- substr($pma_uri_parts['path'], 0, strrpos($pma_uri_parts['path'], '/')),
+ setcookie('pma_server_filename_template', $filename_template , 0,
+ substr($pma_uri_parts['path'], 0, strrpos($pma_uri_parts['path'], '/')),
'', ($pma_uri_parts['scheme'] == 'https'));
}
$filename = str_replace('__SERVER__', $GLOBALS['cfg']['Server']['host'], strftime($filename_template));
} elseif ($export_type == 'database') {
if (isset($remember_template)) {
- setcookie('pma_db_filename_template', $filename_template , 0,
- substr($pma_uri_parts['path'], 0, strrpos($pma_uri_parts['path'], '/')),
+ setcookie('pma_db_filename_template', $filename_template , 0,
+ substr($pma_uri_parts['path'], 0, strrpos($pma_uri_parts['path'], '/')),
'', ($pma_uri_parts['scheme'] == 'https'));
}
$filename = str_replace('__DB__', $db, str_replace('__SERVER__', $GLOBALS['cfg']['Server']['host'], strftime($filename_template)));
} else {
if (isset($remember_template)) {
- setcookie('pma_table_filename_template', $filename_template , 0,
- substr($pma_uri_parts['path'], 0, strrpos($pma_uri_parts['path'], '/')),
+ setcookie('pma_table_filename_template', $filename_template , 0,
+ substr($pma_uri_parts['path'], 0, strrpos($pma_uri_parts['path'], '/')),
'', ($pma_uri_parts['scheme'] == 'https'));
}
$filename = str_replace('__TABLE__', $table, str_replace('__DB__', $db, str_replace('__SERVER__', $GLOBALS['cfg']['Server']['host'], strftime($filename_template))));
@@ -263,16 +263,16 @@ function PMA_exportOutputHandler($line)
}
if (isset($message)) {
$js_to_run = 'functions.js';
- include('./header.inc.php');
+ require_once('./header.inc.php');
if ($export_type == 'server') {
$active_page = 'server_export.php';
- include('./server_export.php');
+ require('./server_export.php');
} elseif ($export_type == 'database') {
$active_page = 'db_details_export.php';
- include('./db_details_export.php');
+ require('./db_details_export.php');
} else {
$active_page = 'tbl_properties_export.php';
- include('./tbl_properties_export.php');
+ require('./tbl_properties_export.php');
}
exit();
}
@@ -299,7 +299,7 @@ function PMA_exportOutputHandler($line)
} else {
// HTML
$backup_cfgServer = $cfg['Server'];
- include('./header.inc.php');
+ require_once('./header.inc.php');
$cfg['Server'] = $backup_cfgServer;
unset($backup_cfgServer);
echo '<div align="' . $cell_align_left . '">' . "\n";
@@ -314,16 +314,16 @@ function PMA_exportOutputHandler($line)
if ($num_tables == 0) {
$message = $strNoTablesFound;
$js_to_run = 'functions.js';
- include('./header.inc.php');
+ require_once('./header.inc.php');
if ($export_type == 'server') {
$active_page = 'server_export.php';
- include('./server_export.php');
+ require('./server_export.php');
} elseif ($export_type == 'database') {
$active_page = 'db_details_export.php';
- include('./db_details_export.php');
+ require('./db_details_export.php');
} else {
$active_page = 'tbl_properties_export.php';
- include('./tbl_properties_export.php');
+ require('./tbl_properties_export.php');
}
exit();
}
@@ -337,11 +337,11 @@ function PMA_exportOutputHandler($line)
$do_comments = isset($GLOBALS[$what . '_comments']);
$do_mime = isset($GLOBALS[$what . '_mime']);
if ($do_relation || $do_comments || $do_mime) {
- require('./libraries/relation.lib.php');
+ require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam();
}
if ($do_mime) {
- require('./libraries/transformations.lib.php');
+ require_once('./libraries/transformations.lib.php');
}
// Include dates in export?
@@ -358,7 +358,7 @@ function PMA_exportOutputHandler($line)
if ($server > 0 && empty($dblist)) {
PMA_availableDatabases();
}
-
+
if (isset($db_select)) {
$tmp_select = implode($db_select, '|');
$tmp_select = '|' . $tmp_select . '|';
@@ -455,10 +455,9 @@ function PMA_exportOutputHandler($line)
if (@function_exists('bzcompress')) {
$dump_buffer = bzcompress($dump_buffer);
if ($dump_buffer === -8) {
- include('./header.inc.php');
+ require_once('./header.inc.php');
echo sprintf($strBzError, '<a href="http://bugs.php.net/bug.php?id=17300" target="_blank">17300</a>');
- include('./footer.inc.php');
- exit;
+ require_once('./footer.inc.php');
}
}
}
@@ -481,16 +480,16 @@ function PMA_exportOutputHandler($line)
}
$js_to_run = 'functions.js';
- include('./header.inc.php');
+ require_once('./header.inc.php');
if ($export_type == 'server') {
$active_page = 'server_export.php';
- include('./server_export.php');
+ require_once('./server_export.php');
} elseif ($export_type == 'database') {
$active_page = 'db_details_export.php';
- include('./db_details_export.php');
+ require_once('./db_details_export.php');
} else {
$active_page = 'tbl_properties_export.php';
- include('./tbl_properties_export.php');
+ require_once('./tbl_properties_export.php');
}
exit();
} else {
@@ -507,6 +506,6 @@ function PMA_exportOutputHandler($line)
echo ' </pre>' . "\n";
echo '</div>' . "\n";
echo "\n";
- include('./footer.inc.php');
+ require_once('./footer.inc.php');
} // end if
-?>
+?>
View
23 footer.inc.php
@@ -2,10 +2,15 @@
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
-// In this file you may add PHP or HTML statements that will be used to define
-// the footer for phpMyAdmin pages.
+/**
+ * In this file you may add PHP or HTML statements that will be used to define
+ * the footer for phpMyAdmin pages.
+ *
+ * WARNING: This script has to be included at the very end of your code because
+ * it will stop the script execution!
+ */
-require('./libraries/relation.lib.php'); // for PMA_setHistory()
+require_once('./libraries/relation.lib.php'); // for PMA_setHistory()
/**
* Query window
@@ -14,6 +19,7 @@
// If query window is wanted and open, update with latest selected db/table.
if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
?>
+
<script type="text/javascript">
<!--
<?php
@@ -137,10 +143,10 @@ function focus_querywindow(sql_query) {
&& isset($GLOBALS['cfg']['DBG']['profile']['enable'])
&& $GLOBALS['cfg']['DBG']['profile']['enable']) {
//run the basic setup code first
- include('./libraries/dbg/setup.php');
+ require_once('./libraries/dbg/setup.php');
//if the setup ran fine, then do the profiling
if (isset($GLOBALS['DBG']) && $GLOBALS['DBG']) {
- include('./libraries/dbg/profiling.php');
+ require_once('./libraries/dbg/profiling.php');
dbg_dump_profiling_results();
}
}
@@ -153,4 +159,9 @@ function focus_querywindow(sql_query) {
PMA_outBufferPost($GLOBALS['ob_mode']);
}
-?>
+/**
+ * Stops the script execution
+ */
+exit;
+
+?>
View
279 header.inc.php
@@ -2,161 +2,154 @@
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
-if (!defined('PMA_HEADER_INC_INCLUDED')) {
- define('PMA_HEADER_INC_INCLUDED', 1);
-
- /**
- * Gets a core script and starts output buffering work
- */
- if (!defined('PMA_COMMON_LIB_INCLUDED')) {
- include('./libraries/common.lib.php');
- }
- if (!defined('PMA_OB_LIB_INCLUDED')) {
- include('./libraries/ob.lib.php');
- }
- if ($GLOBALS['cfg']['OBGzip']) {
- $GLOBALS['ob_mode'] = PMA_outBufferModeGet();
- if ($GLOBALS['ob_mode']) {
- PMA_outBufferPre($GLOBALS['ob_mode']);
- }
+/**
+ * Gets a core script and starts output buffering work
+ */
+require_once('./libraries/common.lib.php');
+require_once('./libraries/ob.lib.php');
+if ($GLOBALS['cfg']['OBGzip']) {
+ $GLOBALS['ob_mode'] = PMA_outBufferModeGet();
+ if ($GLOBALS['ob_mode']) {
+ PMA_outBufferPre($GLOBALS['ob_mode']);
}
+}
- // garvin: For re-usability, moved http-headers and stylesheets
- // to a seperate file. It can now be included by header.inc.php,
- // queryframe.php, querywindow.php.
+// garvin: For re-usability, moved http-headers and stylesheets
+// to a seperate file. It can now be included by header.inc.php,
+// queryframe.php, querywindow.php.
- include('./libraries/header_http.inc.php');
- include('./libraries/header_meta_style.inc.php');
+require_once('./libraries/header_http.inc.php');
+require_once('./libraries/header_meta_style.inc.php');
- $title = '';
- if (isset($GLOBALS['db'])) {
- $title .= str_replace('\'', '\\\'', $GLOBALS['db']);
- }
- if (isset($GLOBALS['table'])) {
- $title .= (empty($title) ? '' : '.') . str_replace('\'', '\\\'', $GLOBALS['table']);
- }
- if (!empty($GLOBALS['cfg']['Server']) && isset($GLOBALS['cfg']['Server']['host'])) {
- $title .= (empty($title) ? 'phpMyAdmin ' : ' ')
- . sprintf($GLOBALS['strRunning'], (empty($GLOBALS['cfg']['Server']['verbose']) ? str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['host']) : str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['verbose'])));
- }
- $title .= (empty($title) ? '' : ' - ') . 'phpMyAdmin ' . PMA_VERSION;
+$title = '';
+if (isset($GLOBALS['db'])) {
+ $title .= str_replace('\'', '\\\'', $GLOBALS['db']);
+}
+if (isset($GLOBALS['table'])) {
+ $title .= (empty($title) ? '' : '.') . str_replace('\'', '\\\'', $GLOBALS['table']);
+}
+if (!empty($GLOBALS['cfg']['Server']) && isset($GLOBALS['cfg']['Server']['host'])) {
+ $title .= (empty($title) ? 'phpMyAdmin ' : ' ')
+ . sprintf($GLOBALS['strRunning'], (empty($GLOBALS['cfg']['Server']['verbose']) ? str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['host']) : str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['verbose'])));
+}
+$title .= (empty($title) ? '' : ' - ') . 'phpMyAdmin ' . PMA_VERSION;
+?>
+<script type="text/javascript" language="javascript">
+<!--
+// Updates the title of the frameset if possible (ns4 does not allow this)
+if (typeof(parent.document) != 'undefined' && typeof(parent.document) != 'unknown'
+ && typeof(parent.document.title) == 'string') {
+ parent.document.title = '<?php echo $title; ?>';
+}
+<?php
+// Add some javascript instructions if required
+if (isset($js_to_run) && $js_to_run == 'functions.js') {
+ echo "\n";
?>
- <script type="text/javascript" language="javascript">
- <!--
- // Updates the title of the frameset if possible (ns4 does not allow this)
- if (typeof(parent.document) != 'undefined' && typeof(parent.document) != 'unknown'
- && typeof(parent.document.title) == 'string') {
- parent.document.title = '<?php echo $title; ?>';
- }
+// js form validation stuff
+var errorMsg0 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strFormEmpty']); ?>';
+var errorMsg1 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotNumber']); ?>';
+var errorMsg2 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotValidNumber']); ?>';
+var noDropDbMsg = '<?php echo((!$GLOBALS['cfg']['AllowUserDropDatabase']) ? str_replace('\'', '\\\'', $GLOBALS['strNoDropDatabases']) : ''); ?>';
+var confirmMsg = '<?php echo(($GLOBALS['cfg']['Confirm']) ? str_replace('\'', '\\\'', $GLOBALS['strDoYouReally']) : ''); ?>';
+//-->
+</script>
+<script src="libraries/functions.js" type="text/javascript" language="javascript"></script>
<?php
- // Add some javascript instructions if required
- if (isset($js_to_run) && $js_to_run == 'functions.js') {
- echo "\n";
- ?>
- // js form validation stuff
- var errorMsg0 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strFormEmpty']); ?>';
- var errorMsg1 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotNumber']); ?>';
- var errorMsg2 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotValidNumber']); ?>';
- var noDropDbMsg = '<?php echo((!$GLOBALS['cfg']['AllowUserDropDatabase']) ? str_replace('\'', '\\\'', $GLOBALS['strNoDropDatabases']) : ''); ?>';
- var confirmMsg = '<?php echo(($GLOBALS['cfg']['Confirm']) ? str_replace('\'', '\\\'', $GLOBALS['strDoYouReally']) : ''); ?>';
- //-->
- </script>
- <script src="libraries/functions.js" type="text/javascript" language="javascript"></script>
- <?php
- } else if (isset($js_to_run) && $js_to_run == 'user_password.js') {
- echo "\n";
- ?>
- // js form validation stuff
- var jsHostEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strHostEmpty']); ?>';
- var jsUserEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strUserEmpty']); ?>';
- var jsPasswordEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordEmpty']); ?>';
- var jsPasswordNotSame = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordNotSame']); ?>';
- //-->
- </script>
- <script src="libraries/user_password.js" type="text/javascript" language="javascript"></script>
- <?php
- } else if (isset($js_to_run) && $js_to_run == 'server_privileges.js') {
- echo "\n";
- ?>
- // js form validation stuff
- var jsHostEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strHostEmpty']); ?>';
- var jsUserEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strUserEmpty']); ?>';
- var jsPasswordEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordEmpty']); ?>';
- var jsPasswordNotSame = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordNotSame']); ?>';
- //-->
- </script>
- <script src="libraries/server_privileges.js" type="text/javascript" language="javascript"></script>
- <?php
- } else if (isset($js_to_run) && $js_to_run == 'indexes.js') {
- echo "\n";
- ?>
- // js index validation stuff
- var errorMsg0 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strFormEmpty']); ?>';
- var errorMsg1 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotNumber']); ?>';
- var errorMsg2 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotValidNumber']); ?>';
- //-->
- </script>
- <script src="libraries/indexes.js" type="text/javascript" language="javascript"></script>
- <?php
- } else if (isset($js_to_run) && $js_to_run == 'tbl_change.js') {
- echo "\n";
- ?>
- //-->
- </script>
- <script src="libraries/tbl_change.js" type="text/javascript" language="javascript"></script>
- <?php
- } else {
- echo "\n";
- ?>
- //-->
- </script>
- <?php
- }
+} else if (isset($js_to_run) && $js_to_run == 'user_password.js') {
echo "\n";
?>
- <meta name="OBGZip" content="<?php echo ($cfg['OBGzip'] ? 'true' : 'false'); ?>" />
- </head>
-
-
+// js form validation stuff
+var jsHostEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strHostEmpty']); ?>';
+var jsUserEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strUserEmpty']); ?>';
+var jsPasswordEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordEmpty']); ?>';
+var jsPasswordNotSame = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordNotSame']); ?>';
+//-->
+</script>
+<script src="libraries/user_password.js" type="text/javascript" language="javascript"></script>
<?php
- if ($GLOBALS['cfg']['RightBgImage'] != '') {
- $bkg_img = ' background="' . $GLOBALS['cfg']['RightBgImage'] . '"';
- } else {
- $bkg_img = '';
- }
+} else if (isset($js_to_run) && $js_to_run == 'server_privileges.js') {
+ echo "\n";
?>
- <body bgcolor="<?php echo $GLOBALS['cfg']['RightBgColor'] . '"' . $bkg_img; ?>>
+// js form validation stuff
+var jsHostEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strHostEmpty']); ?>';
+var jsUserEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strUserEmpty']); ?>';
+var jsPasswordEmpty = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordEmpty']); ?>';
+var jsPasswordNotSame = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordNotSame']); ?>';
+//-->
+</script>
+<script src="libraries/server_privileges.js" type="text/javascript" language="javascript"></script>
<?php
- if (!defined('PMA_DISPLAY_HEADING')) {
- define('PMA_DISPLAY_HEADING', 1);
- }
- if (PMA_DISPLAY_HEADING) {
- $header_url_qry = '?' . PMA_generate_common_url();
- echo '<h1>' . "\n";
- $server_info = (!empty($cfg['Server']['verbose'])
- ? $cfg['Server']['verbose']
- : $server_info = $cfg['Server']['host'] . (empty($cfg['Server']['port'])
- ? ''
- : ':' . $cfg['Server']['port']
- )
- );
- if (isset($GLOBALS['db'])) {
- echo ' ' . $GLOBALS['strDatabase'] . ' <i><a class="h1" href="' . $GLOBALS['cfg']['DefaultTabDatabase'] . $header_url_qry . '&amp;db=' . urlencode($GLOBALS['db']) . '">' . htmlspecialchars($GLOBALS['db']) . '</a></i>' . "\n";
- if (!empty($GLOBALS['table'])) {
- echo ' - ' . $GLOBALS['strTable'] . ' <i><a class="h1" href="' . $GLOBALS['cfg']['DefaultTabTable'] . $header_url_qry . '&amp;db=' . urlencode($GLOBALS['db']) . '&amp;table=' . urlencode($GLOBALS['table']) . '">' . htmlspecialchars($GLOBALS['table']) . '</a></i>' . "\n";
- }
- echo ' ' . sprintf($GLOBALS['strRunning'], '<i><a class="h1" href="' . $GLOBALS['cfg']['DefaultTabServer'] . $header_url_qry . '">' . htmlspecialchars($server_info) . '</a></i>');
- } else {
- echo ' ' . sprintf($GLOBALS['strServer'], '<i><a class="h1" href="' . $GLOBALS['cfg']['DefaultTabServer'] . $header_url_qry . '">' . htmlspecialchars($server_info) . '</a></i>');
+} else if (isset($js_to_run) && $js_to_run == 'indexes.js') {
+ echo "\n";
+ ?>
+// js index validation stuff
+var errorMsg0 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strFormEmpty']); ?>';
+var errorMsg1 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotNumber']); ?>';
+var errorMsg2 = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotValidNumber']); ?>';
+//-->
+</script>
+<script src="libraries/indexes.js" type="text/javascript" language="javascript"></script>
+ <?php
+} else if (isset($js_to_run) && $js_to_run == 'tbl_change.js') {
+ echo "\n";
+ ?>
+//-->
+</script>
+<script src="libraries/tbl_change.js" type="text/javascript" language="javascript"></script>
+ <?php
+} else {
+ echo "\n";
+ ?>
+//-->
+</script>
+ <?php
+}
+echo "\n";
+?>
+ <meta name="OBGZip" content="<?php echo ($cfg['OBGzip'] ? 'true' : 'false'); ?>" />
+</head>
+
+
+<?php
+if ($GLOBALS['cfg']['RightBgImage'] != '') {
+ $bkg_img = ' background="' . $GLOBALS['cfg']['RightBgImage'] . '"';
+} else {
+ $bkg_img = '';
+}
+?>
+<body bgcolor="<?php echo $GLOBALS['cfg']['RightBgColor'] . '"' . $bkg_img; ?>>
+<?php
+if (!defined('PMA_DISPLAY_HEADING')) {
+ define('PMA_DISPLAY_HEADING', 1);
+}
+if (PMA_DISPLAY_HEADING) {
+ $header_url_qry = '?' . PMA_generate_common_url();
+ echo '<h1>' . "\n";
+ $server_info = (!empty($cfg['Server']['verbose'])
+ ? $cfg['Server']['verbose']
+ : $server_info = $cfg['Server']['host'] . (empty($cfg['Server']['port'])
+ ? ''
+ : ':' . $cfg['Server']['port']
+ )
+ );
+ if (isset($GLOBALS['db'])) {
+ echo ' ' . $GLOBALS['strDatabase'] . ' <i><a class="h1" href="' . $GLOBALS['cfg']['DefaultTabDatabase'] . $header_url_qry . '&amp;db=' . urlencode($GLOBALS['db']) . '">' . htmlspecialchars($GLOBALS['db']) . '</a></i>' . "\n";
+ if (!empty($GLOBALS['table'])) {
+ echo ' - ' . $GLOBALS['strTable'] . ' <i><a class="h1" href="' . $GLOBALS['cfg']['DefaultTabTable'] . $header_url_qry . '&amp;db=' . urlencode($GLOBALS['db']) . '&amp;table=' . urlencode($GLOBALS['table']) . '">' . htmlspecialchars($GLOBALS['table']) . '</a></i>' . "\n";
}
- echo "\n" . '</h1>' . "\n";
+ echo ' ' . sprintf($GLOBALS['strRunning'], '<i><a class="h1" href="' . $GLOBALS['cfg']['DefaultTabServer'] . $header_url_qry . '">' . htmlspecialchars($server_info) . '</a></i>');
+ } else {
+ echo ' ' . sprintf($GLOBALS['strServer'], '<i><a class="h1" href="' . $GLOBALS['cfg']['DefaultTabServer'] . $header_url_qry . '">' . htmlspecialchars($server_info) . '</a></i>');
}
- echo "\n";
+ echo "\n" . '</h1>' . "\n";
+}
+echo "\n";
+
+/**
+ * Sets a variable to remember headers have been sent
+ */
+$GLOBALS['is_header_sent'] = TRUE;
- /**
- * Sets a variable to remember headers have been sent
- */
- $GLOBALS['is_header_sent'] = TRUE;
-} // PMA_HEADER_INC_INCLUDED
-?>
+?>
View
8 header_printview.inc.php
@@ -5,8 +5,8 @@
/**
* Gets a core script and starts output buffering work
*/
-require('./libraries/common.lib.php');
-require('./libraries/ob.lib.php');
+require_once('./libraries/common.lib.php');
+require_once('./libraries/ob.lib.php');
if ($cfg['OBGzip']) {
$ob_mode = PMA_outBufferModeGet();
if ($ob_mode) {
@@ -23,7 +23,7 @@
// to a seperate file. It can now be included by header.inc.php,
// queryframe.php, querywindow.php.
-include('./libraries/header_http.inc.php');
+require_once('./libraries/header_http.inc.php');
/**
* Sends the beginning of the html page then returns to the calling script
@@ -68,4 +68,4 @@
* Sets a variable to remember headers have been sent
*/
$is_header_sent = TRUE;
-?>
+?>
View
8 index.php
@@ -6,8 +6,8 @@
/**
* Gets core libraries and defines some variables
*/
-require('./libraries/grab_globals.lib.php');
-require('./libraries/common.lib.php');
+require_once('./libraries/grab_globals.lib.php');
+require_once('./libraries/common.lib.php');
// Gets the default font sizes
PMA_setFontSizes();
@@ -41,7 +41,7 @@
header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
-require('./libraries/relation.lib.php');
+require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam();
if ($cfg['QueryHistoryDB'] && $cfgRelation['historywork']) {
@@ -112,4 +112,4 @@
}
?>
-</html>
+</html>
View
16 ldi_check.php
@@ -18,8 +18,8 @@
/**
* Gets some core scripts
*/
-require('./libraries/grab_globals.lib.php');
-require('./libraries/common.lib.php');
+require_once('./libraries/grab_globals.lib.php');
+require_once('./libraries/common.lib.php');
// Check parameters
@@ -80,9 +80,9 @@
*/
if (isset($btnLDI) && empty($textfile)) {
$js_to_run = 'functions.js';
- include('./header.inc.php');
+ require_once('./header.inc.php');
$message = $strMustSelectFile;
- include('./ldi_table.php');
+ require('./ldi_table.php');
} elseif (isset($btnLDI) && ($textfile != 'none')) {
if (!isset($replace)) {
$replace = '';
@@ -91,7 +91,7 @@
// the error message does not correspond exactly to the error...
if (!@chmod($textfile, 0644)) {
echo $strFileCouldNotBeRead . ' ' . $textfile . '<br />';
- exit();
+ require_once('./footer.inc.php');
}
// Kanji encoding convert appended by Y.Kawada
@@ -159,7 +159,7 @@
//
// The $goto in ldi_table.php is set to tbl_properties.php but maybe
// if would be better to Browse the latest inserted data.
- include('./sql.php');
+ require('./sql.php');
if ($unlink_local_textfile) {
unlink($textfile);
}
@@ -170,6 +170,6 @@
* The form used to define the query hasn't been yet submitted -> loads it
*/
else {
- include('./ldi_table.php');
+ require('./ldi_table.php');
}
-?>
+?>
View
12 ldi_table.php
@@ -7,12 +7,10 @@
* This file defines the forms used to insert a textfile into a table
*/
-require('./libraries/grab_globals.lib.php');
+require_once('./libraries/grab_globals.lib.php');
// Check parameters
-if (!defined('PMA_COMMON_LIB_INCLUDED')) {
- include('./libraries/common.lib.php');
-}
+require_once('./libraries/common.lib.php');
PMA_checkParameters(array('db', 'table'));
@@ -165,7 +163,7 @@
<tr>
<td><?php echo $strLoadMethod; ?>
</td>
- <td>
+ <td>
<input type="radio" id="radio_local_option_0" name="local_option" value="0" <?php echo (!$local_option_selected ? ' checked="checked" ' : ''); ?>/><label for="radio_local_option_0">...DATA</label><br />
<input type="radio" id="radio_local_option_1" name="local_option" value="1" <?php echo ($local_option_selected ? ' checked="checked" ' : ''); ?>/><label for="radio_local_option_1">...DATA LOCAL</label>
</td>
@@ -194,5 +192,5 @@
/**
* Displays the footer
*/
-require('./footer.inc.php');
-?>
+require_once('./footer.inc.php');
+?>
View
54 left.php
@@ -7,7 +7,7 @@
* Gets the variables sent to this script, retains the db name that may have
* been defined as startup option and include a core library
*/
-require('./libraries/grab_globals.lib.php');
+require_once('./libraries/grab_globals.lib.php');
if (isset($lightm_db) && !empty($lightm_db)) {
// no longer urlencoded because of html entities in the db name
// $db = urldecode($lightm_db);
@@ -22,8 +22,8 @@
/**
* Gets a core script and starts output buffering work
*/
-require('./libraries/common.lib.php');
-require('./libraries/ob.lib.php');
+require_once('./libraries/common.lib.php');
+require_once('./libraries/ob.lib.php');
if ($cfg['OBGzip']) {
$ob_mode = PMA_outBufferModeGet();
if ($ob_mode) {
@@ -33,8 +33,8 @@
PMA_checkParameters(array('hash'));
-include('./libraries/bookmark.lib.php');
-require('./libraries/relation.lib.php');
+require_once('./libraries/bookmark.lib.php');
+require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam();
function PMA_reduceNest($_table) {
@@ -63,7 +63,7 @@ function PMA_indent($spaces) {
for ($i = 0; $i <= $spaces; $i++) {
$string .= ' ';
}
-
+
return $string;
}
@@ -83,7 +83,7 @@ function PMA_nestedSetHeaderParent($baseid, $key, $keyhistory, $indent, $indent_
}
$counter = count($countarray);
}
-
+
echo "\n";
echo PMA_indent($indent * 5) . '<div id="el' . $id . 'Parent" class="parent"' . $on_mouse . '>' . "\n";
echo PMA_indent($indent * 6) . '<nobr><img src="images/spacer.gif" border="0" width="' . (($indent - 1) * $indent_level) . '" height="9" alt="" /><a class="item" href="' . $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . $GLOBALS['common_url_query'] . '" onclick="if (capable) {expandBase(\'el' . $id . '\', true); return false} else {return true}">';
@@ -102,25 +102,25 @@ function PMA_nestedSetHeader($baseid, $tablestack, $keyhistory, $indent, $indent
PMA_nestedSetHeaderParent($baseid, $firstGroup, $keyhistory, $indent, $indent_level, $tablestack);
$indent++;
}
-
+
foreach($tablestack AS $key => $val) {
if ($key != 'pma_name' && $key != 'pma_list_item') {
if ($headerOut) {
PMA_nestedSetHeaderParent($baseid, $key, $keyhistory, $indent, $indent_level, $val);
}
-
+
if (isset($val['pma_name']) && isset($val['pma_list_item']) && count($val) == 2) {
PMA_nestedSet($baseid, $val, $key, $keyhistory . $key, false, ($indent + 1));
} else {
PMA_nestedSet($baseid, $val, $key, $keyhistory . $key, true, ($indent + 1));
}
-
+
if ($headerOut) {
echo PMA_indent($indent * 5) . '</div><id class="PMA_nestedSetHeader">' . "\n";
}
}
}
-
+
if ($firstGroup && $firstGroupClose) {
echo PMA_indent($indent * 4) . '</div><id class="PMA_nestedSetHeader2">' . "\n";
} elseif ($firstGroup) {
@@ -133,13 +133,13 @@ function PMA_nestedSet($baseid, $tablestack, $key = '__protected__', $keyhistory
if ($keyhistory == '' && $key != '__protected__') {
$keyhistory = $key;
}
-
+
$indent_level = 9;
-
+
if (isset($tablestack)
&& isset($tablestack['pma_name'])
&& isset($tablestack['pma_list_item'])) {
-
+
if (count($tablestack) > 1 && !empty($key) && isset($tablestack['pma_name']) && isset($tablestack['pma_list_item']) && $indent == 1) {
PMA_nestedSetHeader($baseid, $tablestack, $keyhistory, ($indent+1), $indent_level, $headerOut, $key, false);
$divClose = true;
@@ -151,7 +151,7 @@ function PMA_nestedSet($baseid, $tablestack, $key = '__protected__', $keyhistory
}
$on_mouse = (($GLOBALS['cfg']['LeftPointerColor'] == '') ? '' : ' onmouseover="if (isDOM || isIE4) {hilightBase(\'el' . $keyhistory . $key . '\', \'' . $GLOBALS['cfg']['LeftPointerColor'] . '\')}" onmouseout="if (isDOM || isIE4) {hilightBase(\'el' . $keyhistory . $key . '\', \'' . $GLOBALS['cfg']['LeftBgColor'] . '\')}"');
-
+
$loops = 0;
foreach($tablestack['pma_name'] AS $tkey => $tval) {
@@ -162,18 +162,18 @@ function PMA_nestedSet($baseid, $tablestack, $key = '__protected__', $keyhistory
echo PMA_indent(($indent * 5)) . $ival;
}
echo "\n";
-
+
$loops++;
}
-
+
if ($divClose) {
echo PMA_indent($indent * 5) . '</div><id space="putting omitted div" class="PMA_nestedSet2">';
}
} elseif (is_array($tablestack)) {
PMA_nestedSetHeader($baseid, $tablestack, $keyhistory, (($key == '__protected__' && $indent == 1 )? ($indent-1) : ($indent + 1)), $indent_level, $headerOut, (($key == '__protected__' && $indent == 1) || ($indent > 1) ? false : $key));
}
-
+
return true;
}
/**
@@ -192,7 +192,7 @@ function PMA_nestedSet($baseid, $tablestack, $key = '__protected__', $keyhistory
// to a seperate file. It can now be included by header.inc.php,
// queryframe.php, querywindow.php.
-include('./libraries/header_http.inc.php');
+require_once('./libraries/header_http.inc.php');
/**
* Displays the frame
@@ -215,11 +215,11 @@ function PMA_nestedSet($baseid, $tablestack, $key = '__protected__', $keyhistory
if (isset($lightm_db) && !empty($lightm_db)) {
?>
window.parent.frames['phpmain<?php echo $hash; ?>'].location.replace('./<?php echo $cfg['DefaultTabDatabase'] . '?' . PMA_generate_common_url($db, '', '&');?>');
-<?php
+<?php
} elseif (isset($lightm_db)) {
?>
window.parent.frames['phpmain<?php echo $hash; ?>'].location.replace('./main.php?<?php echo PMA_generate_common_url('', '', '&');?>');
-<?php
+<?php
}
?>
//-->
@@ -479,7 +479,7 @@ function PMA_nestedSet($baseid, $tablestack, $key = '__protected__', $keyhistory
$list_item .= '<bdo dir="' . $text_dir . '">&nbsp;</bdo>' . "\n";
$list_item .= '<a class="tblItem" id="tbl_' . md5($table) . '" title="' . $url_title . '" target="phpmain' . $hash . '" href="' . $cfg['DefaultTabTable'] . '?' . $common_url_query . '&amp;table=' . urlencode($table) . '">';
$list_item .= ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)) . '</a></nobr><br />' . "\n";
-
+
// garvin: Check whether to display nested sets
if (!empty($cfg['LeftFrameTableSeparator'])) {
$_table = explode($cfg['LeftFrameTableSeparator'], str_replace('\'', '\\\'',$table));
@@ -492,7 +492,7 @@ function PMA_nestedSet($baseid, $tablestack, $key = '__protected__', $keyhistory
unset($_table[count($_table)-1]);
$_table = PMA_reduceNest($_table);
-
+
$eval_string = '$tablestack[\'' . implode('\'][\'', $_table) . '\'][\'pma_name\'][] = \'' . str_replace('\'', '\\\'', $table) . '\';';
$eval_string .= '$tablestack[\'' . implode('\'][\'', $_table) . '\'][\'pma_list_item\'][] = \'' . str_replace('\'', '\\\'', $list_item) . '\';';
eval($eval_string);
@@ -505,7 +505,7 @@ function PMA_nestedSet($baseid, $tablestack, $key = '__protected__', $keyhistory
$tablestack['']['pma_list_item'][] = $list_item;
}
} // end for $t (tables list)
-
+
PMA_nestedSet($j, $tablestack);
?>
</div>
@@ -708,7 +708,7 @@ function PMA_nestedSet($baseid, $tablestack, $key = '__protected__', $keyhistory
$list_item .= '<bdo dir="' . $text_dir . '">&nbsp;</bdo>' . "\n";
$list_item .= '<a class="tblItem" id="tbl_' . md5($table) . '" title="' . $url_title . '" target="phpmain' . $hash . '" href="' . $cfg['DefaultTabTable'] . '?' . $common_url_query . '&amp;table=' . urlencode($table) . '">';
$list_item .= ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)) . '</a></nobr><br />';
-
+
// garvin: Check whether to display nested sets
if (!empty($cfg['LeftFrameTableSeparator'])) {
$_table = explode($cfg['LeftFrameTableSeparator'], $table);
@@ -755,7 +755,7 @@ function PMA_nestedSet($baseid, $tablestack, $key = '__protected__', $keyhistory
} else {
echo ' </div>';
}
-
+
echo "\n";
} // end if ($num_dbs == 1)
@@ -790,4 +790,4 @@ function PMA_nestedSet($baseid, $tablestack, $key = '__protected__', $keyhistory
&& isset($ob_mode) && $ob_mode) {
PMA_outBufferPost($ob_mode);
}
-?>
+?>
View
162 libraries/auth/config.auth.lib.php
@@ -8,92 +8,89 @@
// +--------------------------------------------------------------------------+
-if (!defined('PMA_CONFIG_AUTH_INCLUDED')) {
- define('PMA_CONFIG_AUTH_INCLUDED', 1);
-
- /**
- * Displays authentication form
- *
- * @return boolean always true
- *
- * @access public
- */
- function PMA_auth()
- {
- return TRUE;
- } // end of the 'PMA_auth()' function
+/**
+ * Displays authentication form
+ *
+ * @return boolean always true
+ *
+ * @access public
+ */
+function PMA_auth()
+{
+ return TRUE;
+} // end of the 'PMA_auth()' function
- /**
- * Gets advanced authentication settings
- *
- * @return boolean always true
- *
- * @access public
- */
- function PMA_auth_check