Huge set of optimizations, please test!

This commit is contained in:
Alexander M. Turek
2003-11-26 22:52:25 +00:00
parent 0500480bcf
commit 37d50c1822
115 changed files with 12275 additions and 12579 deletions

View File

@@ -5,6 +5,23 @@ 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.

View File

@@ -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 @@ PMA_setFontSizes();
<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 @@ if (isset($foreign_navig) && $foreign_navig == $strShowAll) {
unset($foreign_limit);
}
include('./libraries/get_foreign.lib.php');
require('./libraries/get_foreign.lib.php');
?>
<form action="browse_foreigners.php" method="post">

View File

@@ -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 @@ $cfgRelation = PMA_getRelationsParam(TRUE);
/**
* Displays the footer
*/
echo "\n";
require('./footer.inc.php');
require_once('./footer.inc.php');
?>

View File

@@ -434,10 +434,6 @@ $cfg['AvailableCharsets'] = array(
'SHIFT_JIS'
);
// Loads language file
require('./libraries/select_lang.lib.php');
/**
* Customization & design
*/

View File

@@ -4,8 +4,8 @@
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
@@ -13,7 +13,7 @@ require('./libraries/common.lib.php');
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 File

@@ -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 @@ $result = PMA_mysql_query('CREATE DATABASE ' . PMA_backquote($db)) or PMA_m
* Displays the result and calls default page
*/
$message = $strDatabase . ' ' . htmlspecialchars($db) . ' ' . $strHasBeenCreated;
require('./' . $cfg['DefaultTabDatabase']);
require_once('./' . $cfg['DefaultTabDatabase']);
?>

View File

@@ -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 File

@@ -35,7 +35,7 @@ $sub_part = '';
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();
}
@@ -200,5 +200,5 @@ if (function_exists('PMA_set_enc_form')) {
* Displays the footer
*/
echo "\n";
require('./footer.inc.php');
require_once('./footer.inc.php');
?>

View File

@@ -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 (!isset($is_db) || !$is_db) {
}
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";

View File

@@ -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'));

View File

@@ -52,15 +52,14 @@ if ($num_tables > 1) {
<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 File

@@ -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'));
@@ -148,7 +148,7 @@ if (isset($cfg['docSQLDir']) && !empty($cfg['docSQLDir'])) {
}
// 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
@@ -299,6 +299,6 @@ if (isset($cfg['docSQLDir']) && !empty($cfg['docSQLDir'])) {
* Displays the footer
*/
echo "\n";
require('./footer.inc.php');
require_once('./footer.inc.php');
?>

View File

@@ -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 @@ if (isset($submit_sql) && preg_match('@^SELECT@i', $encoded_sql_query)) {
$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 @@ if (!empty($qry_orderby)) {
/**
* Displays the footer
*/
require('./footer.inc.php');
require_once('./footer.inc.php');
?>

View File

@@ -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();
/**
@@ -251,7 +247,7 @@ else {
</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'])) {
@@ -692,5 +688,5 @@ echo "\n" . '</ul>';
* Displays the footer
*/
echo "\n";
require('./footer.inc.php');
require_once('./footer.inc.php');
?>

View File

@@ -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 @@ $err_url = 'db_details.php?' . PMA_generate_common_url($db);
/**
* Settings for relations stuff
*/
require('./libraries/relation.lib.php');
require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam();
/**
@@ -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 File

@@ -379,5 +379,5 @@ echo"\n";
* Displays the footer
*/
echo "\n";
require('./footer.inc.php');
require_once('./footer.inc.php');
?>

View File

@@ -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'));
@@ -263,16 +263,16 @@ if ($save_on_server) {
}
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 @@ if (!$save_on_server) {
} 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 @@ if ($export_type == 'database') {
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 @@ $do_relation = isset($GLOBALS[$what . '_relation']);
$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?
@@ -455,10 +455,9 @@ if (!empty($asfile)) {
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 @@ if (!empty($asfile)) {
}
$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 @@ else {
echo ' </pre>' . "\n";
echo '</div>' . "\n";
echo "\n";
include('./footer.inc.php');
require_once('./footer.inc.php');
} // end if
?>

View File

@@ -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 @@ require('./libraries/relation.lib.php'); // for PMA_setHistory()
// 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 @@ if (isset($GLOBALS['cfg']['DBG']['enable'])
&& 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 @@ if (isset($GLOBALS['cfg']['OBGzip']) && $GLOBALS['cfg']['OBGzip']
PMA_outBufferPost($GLOBALS['ob_mode']);
}
/**
* Stops the script execution
*/
exit;
?>

View File

@@ -2,18 +2,11 @@
/* $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');
}
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']) {
@@ -25,8 +18,8 @@ if (!defined('PMA_HEADER_INC_INCLUDED')) {
// 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'])) {
@@ -158,5 +151,5 @@ if (!defined('PMA_HEADER_INC_INCLUDED')) {
* Sets a variable to remember headers have been sent
*/
$GLOBALS['is_header_sent'] = TRUE;
} // PMA_HEADER_INC_INCLUDED
?>

View File

@@ -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 @@ PMA_checkParameters(array('db', 'full_sql_query'));
// 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

View File

@@ -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 @@ $url_query = PMA_generate_common_url(isset($db) ? $db : '');
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']) {

View File

@@ -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) && isset($local_textfile) && $local_textfile != '') {
*/
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 @@ if (isset($btnLDI) && empty($textfile)) {
// 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 @@ if (isset($btnLDI) && empty($textfile)) {
//
// 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 @@ if (isset($btnLDI) && empty($textfile)) {
* The form used to define the query hasn't been yet submitted -> loads it
*/
else {
include('./ldi_table.php');
require('./ldi_table.php');
}
?>

View File

@@ -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'));
@@ -194,5 +192,5 @@ if (PMA_MYSQL_INT_VERSION > 40003) {
/**
* Displays the footer
*/
require('./footer.inc.php');
require_once('./footer.inc.php');
?>

View File

@@ -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 @@ if (!empty($db)) {
/**
* 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 @@ if ($cfg['OBGzip']) {
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) {
@@ -192,7 +192,7 @@ if ($server > 0) {
// 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

View File

@@ -8,9 +8,6 @@
// +--------------------------------------------------------------------------+
if (!defined('PMA_CONFIG_AUTH_INCLUDED')) {
define('PMA_CONFIG_AUTH_INCLUDED', 1);
/**
* Displays authentication form
*
@@ -124,5 +121,4 @@ h1 {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo
return TRUE;
} // end of the 'PMA_auth_fails()' function
} // $__PMA_CONFIG_AUTH_LIB__
?>

View File

@@ -10,14 +10,11 @@
// +--------------------------------------------------------------------------+
if (!defined('PMA_COOKIE_AUTH_INCLUDED')) {
define('PMA_COOKIE_AUTH_INCLUDED', 1);
if (!isset($coming_from_common)) {
exit();
}
include('./libraries/blowfish.php');
require_once('./libraries/blowfish.php');
// Gets the default font sizes
PMA_setFontSizes();
@@ -340,8 +337,6 @@ input.textfield {font-family: <?php echo $right_font_family; ?>; font-size: <?ph
<?php
} // end if (server choice)
echo "\n";
?>
<?php
if (!empty($conn_error)) {
echo '<tr><td colspan="2" align="center"><p class="warning">'. $conn_error . '</p></td></tr>' . "\n";
}
@@ -609,5 +604,4 @@ if (uname.value == '') {
return TRUE;
} // end of the 'PMA_auth_fails()' function
} // $__PMA_COOKIE_AUTH_LIB__
?>

View File

@@ -8,9 +8,6 @@
// +--------------------------------------------------------------------------+
if (!defined('PMA_HTTP_AUTH_INCLUDED')) {
define('PMA_HTTP_AUTH_INCLUDED', 1);
/**
* Displays authentication form
*
@@ -236,5 +233,4 @@ h1 {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo
return TRUE;
} // end of the 'PMA_auth_fails()' function
} // $__PMA_HTTP_AUTH_LIB__
?>

View File

@@ -7,10 +7,6 @@
*/
if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
define('PMA_BOOKMARK_LIB_INCLUDED', 1);
/**
* Defines the bookmark parameters for the current user
*
@@ -131,14 +127,14 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
$result = PMA_mysql_query($query, $GLOBALS['dbh']);
if (PMA_mysql_error($GLOBALS['dbh'])) {
$error = PMA_mysql_error($GLOBALS['dbh']);
include('./header.inc.php');
require_once('./header.inc.php');
PMA_mysqlDie($error);
}
} else {
$result = PMA_mysql_query($query);
if (PMA_mysql_error()) {
$error = PMA_mysql_error();
include('./header.inc.php');
require_once('./header.inc.php');
PMA_mysqlDie($error);
}
}
@@ -175,6 +171,4 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')) {
*/
$cfg['Bookmark'] = PMA_getBookmarksParam();
} // $__PMA_BOOKMARK_LIB__
?>

View File

@@ -8,9 +8,6 @@
*/
if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
define('PMA_CHARSET_CONVERSION_LIB_INCLUDED', 1);
/**
* Loads the recode or iconv extensions if any of it is not loaded yet
*/
@@ -18,17 +15,12 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
&& $cfg['AllowAnywhereRecoding']
&& $allow_recoding) {
// Initializes configuration for default, if not set:
if (!isset($cfg['RecodingEngine'])) {
$cfg['RecodingEngine'] = 'auto';
}
if ($cfg['RecodingEngine'] == 'recode') {
if (!@extension_loaded('recode')) {
PMA_dl('recode');
if (!@extension_loaded('recode')) {
echo $strCantLoadRecodeIconv;
exit();
exit;
}
}
$PMA_recoding_engine = 'recode';
@@ -37,7 +29,7 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
PMA_dl('iconv');
if (!@extension_loaded('iconv')) {
echo $strCantLoadRecodeIconv;
exit();
exit;
}
}
$PMA_recoding_engine = 'iconv';
@@ -52,7 +44,7 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
PMA_dl('recode');
if (!@extension_loaded('recode')) {
echo $strCantLoadRecodeIconv;
exit();
exit;
} else {
$PMA_recoding_engine = 'recode';
}
@@ -92,7 +84,7 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
include('./header.inc.php');
}
echo $strCantUseRecodeIconv;
include('./footer.inc.php');
require_once('./footer.inc.php');
exit();
}
} else if ($PMA_recoding_engine == 'recode') {
@@ -101,12 +93,10 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
} else {
$PMA_recoding_engine = PMA_CHARSET_NONE;
if (!isset($GLOBALS['is_header_sent'])) {
include('./header.inc.php');
}
require_once('./header.inc.php');
echo $strCantUseRecodeIconv;
include('./footer.inc.php');
exit();
require_once('./footer.inc.php');
exit;
}
} else {
if (@function_exists('iconv')) {
@@ -118,12 +108,10 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
} else {
$PMA_recoding_engine = PMA_CHARSET_NONE;
if (!isset($GLOBALS['is_header_sent'])) {
include('./header.inc.php');
}
require_once('./header.inc.php');
echo $strCantUseRecodeIconv;
include('./footer.inc.php');
exit();
require_once('./footer.inc.php');
exit;
}
}
} else {
@@ -172,13 +160,10 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
switch ($GLOBALS['PMA_recoding_engine']) {
case PMA_CHARSET_RECODE:
return recode_string($convcharset . '..' . $charset, $what);
break;
case PMA_CHARSET_ICONV:
return iconv($convcharset, $charset . $cfg['IconvExtraParams'], $what);
break;
case PMA_CHARSET_LIBICONV:
return libiconv($convcharset, $charset, $what);
break;
default:
return $what;
}
@@ -228,13 +213,10 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
switch ($GLOBALS['PMA_recoding_engine']) {
case PMA_CHARSET_RECODE:
return recode_string($charset . '..' . $convcharset, $what);
break;
case PMA_CHARSET_ICONV:
return iconv($charset, $convcharset . $cfg['IconvExtraParams'], $what);
break;
case PMA_CHARSET_LIBICONV:
return libiconv($charset, $convcharset, $what);
break;
default:
return $what;
}
@@ -259,13 +241,10 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
switch ($GLOBALS['PMA_recoding_engine']) {
case PMA_CHARSET_RECODE:
return recode_string($src_charset . '..' . $dest_charset, $what);
break;
case PMA_CHARSET_ICONV:
return iconv($src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $what);
break;
case PMA_CHARSET_LIBICONV:
return libiconv($src_charset, $dest_charset, $what);
break;
default:
return $what;
}
@@ -313,11 +292,9 @@ if (!defined('PMA_CHARSET_CONVERSION_LIB_INCLUDED')){
unlink($file);
return $tmpfname;
break;
default:
return $file;
}
} // end of the "PMA_convert_file()" function
} // $__PMA_CHARSET_CONVERSION_LIB__
?>

View File

@@ -7,22 +7,16 @@
* Among other things, it contains the advanced authentification work.
*/
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
define('PMA_COMMON_LIB_INCLUDED', 1);
/**
* Order of sections for common.lib.php:
*
* in PHP3, functions and constants must be physically defined
* before they are referenced
*
* some functions need the constants of libraries/defines.lib.php
* and defines_php.lib.php
* and defines_mysql.lib.php
*
* the PMA_setFontSizes() function must be before the call to the
* libraries/auth/cookie.auth.lib.php library
*
* the include of libraries/defines.lib.php must be after the connection
* the include of libraries/defines_mysql.lib.php must be after the connection
* to db to get the MySql version
*
* the PMA_sqlAddslashes() function must be before the connection to db
@@ -38,8 +32,7 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')) {
* ... so the required order is:
*
* - parsing of the configuration file
* - first load of the libraries/defines_php.lib.php library (won't get the
* MySQL release number)
* - load of the libraries/defines.lib.php library
* - load of mysql extension (if necessary)
* - definition of PMA_sqlAddslashes()
* - definition of PMA_format_sql()
@@ -49,8 +42,8 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')) {
* - loading of an authentication library
* - db connection
* - authentication work
* - second load of the libraries/define.lib.php library to get the MySQL
* release number)
* - load of the libraries/defines_mysql.lib.php library to get the MySQL
* release number
* - other functions, respecting dependencies
*/
@@ -86,14 +79,14 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')) {
* versions of phpMyAdmin/php/mysql...
*/
$old_error_reporting = error_reporting(0);
include($cfgfile_to_load);
include_once($cfgfile_to_load);
// Include failed
if (!isset($cfgServers) && !isset($cfg['Servers'])) {
// Creates fake settings
$cfg = array('DefaultLang' => 'en-iso-8859-1',
'AllowAnywhereRecoding' => FALSE);
// Loads the language file
include('./libraries/select_lang.lib.php');
require_once('./libraries/select_lang.lib.php');
// Sends the Content-Type header
header('Content-Type: text/html; charset=' . $charset);
// Displays the error message
@@ -128,8 +121,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
exit();
}
error_reporting($old_error_reporting);
unset($old_error_reporting);
unset($cfgfile_to_load);
unset($old_error_reporting, $cfgfile_to_load);
/**
* Includes compatibility code for older config.inc.php revisions
@@ -144,22 +136,20 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
} else {
$cfg['FileRevision'] = array(1, 1);
}
if ($cfg['FileRevision'][0] < 2) {
include('./libraries/config_import.lib.php');
if ($cfg['FileRevision'][0] < 2 || ($cfg['FileRevision'][0] == 2 && $cfg['FileRevision'][1] < 1)) {
require_once('./libraries/config_import.lib.php');
}
/**
* Includes the language file if it hasn't been included yet
*/
if (!defined('PMA_SELECT_LANG_LIB_INCLUDED')) {
include('./libraries/select_lang.lib.php');
}
require_once('./libraries/select_lang.lib.php');
if ($is_minimum_common == FALSE) {
/**
* Include MySQL wrappers.
*/
include('./libraries/mysql_wrappers.lib.php');
require_once('./libraries/mysql_wrappers.lib.php');
}
/**
@@ -167,7 +157,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
* This include must be located physically before any code that needs to
* reference the constants, else PHP 3.0.16 won't be happy.
*/
include('./libraries/defines_php.lib.php');
require_once('./libraries/defines.lib.php');
if ($is_minimum_common == FALSE) {
/**
@@ -183,43 +173,34 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
/**
* Charset conversion.
*/
include('./libraries/charset_conversion.lib.php');
require_once('./libraries/charset_conversion.lib.php');
}
/**
* Gets constants that defines the MySQL version number.
* This include must be located physically before any code that needs to
* reference the constants, else PHP 3.0.16 won't be happy; and must be
* located after we are connected to db to get the MySql version (see
* below).
*/
include('./libraries/defines.lib.php');
if ($is_minimum_common == FALSE) {
/**
* String handling
*/
include('./libraries/string.lib.php');
require_once('./libraries/string.lib.php');
}
if ($is_minimum_common == FALSE) {
/**
* SQL Parser data
*/
include('./libraries/sqlparser.data.php');
require_once('./libraries/sqlparser.data.php');
}
/**
* SQL Parser code
*/
include('./libraries/sqlparser.lib.php');
require_once('./libraries/sqlparser.lib.php');
if ($is_minimum_common == FALSE) {
/**
* SQL Validator interface code
*/
include('./libraries/sqlvalidator.lib.php');
require_once('./libraries/sqlvalidator.lib.php');
}
// If zlib output compression is set in the php configuration file, no
@@ -241,7 +222,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
/**
* Include URL/hidden inputs generating.
*/
include('./libraries/url_generating.lib.php');
require_once('./libraries/url_generating.lib.php');
/**
* Loads the mysql extensions if it is not loaded yet
@@ -253,7 +234,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
// check whether mysql is available
if (!@function_exists('mysql_connect')) {
if (empty($is_header_sent)) {
include('./libraries/header_http.inc.php');
require_once('./libraries/header_http.inc.php');
}
echo $strCantLoadMySQL . '<br />' . "\n"
. '<a href="./Documentation.html#faqmysql" target="documentation">' . $GLOBALS['strDocu'] . '</a>' . "\n";
@@ -435,9 +416,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
{
global $cfg, $table, $db, $sql_query;
if (empty($GLOBALS['is_header_sent'])) {
include('./header.inc.php');
}
require_once('./header.inc.php');
if (!$error_message) {
$error_message = PMA_mysql_error();
@@ -510,8 +489,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
echo "\n";
if ($exit) {
include('./footer.inc.php');
exit();
require_once('./footer.inc.php');
}
} // end of the 'PMA_mysqlDie()' function
@@ -940,7 +918,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
// (for a quick check of path disclosure in auth/cookies:)
$coming_from_common = TRUE;
include('./libraries/auth/' . $cfg['Server']['auth_type'] . '.auth.lib.php');
require_once('./libraries/auth/' . $cfg['Server']['auth_type'] . '.auth.lib.php');
if (!PMA_auth_check()) {
PMA_auth();
} else {
@@ -954,7 +932,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
// Look at: "static int check_dir_access(request_rec *r)"
// Robbat2 - May 10, 2002
if (isset($cfg['Server']['AllowDeny']) && isset($cfg['Server']['AllowDeny']['order'])) {
include('./libraries/ip_allow_deny.lib.php');
require_once('./libraries/ip_allow_deny.lib.php');
$allowDeny_forbidden = FALSE; // default
if ($cfg['Server']['AllowDeny']['order'] == 'allow,deny') {
@@ -1033,9 +1011,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
. $cfg['Server']['controlpass']
. (empty($client_flags) ? '' : ', FALSE, ' . $client_flags)
. ')';
if (empty($GLOBALS['is_header_sent'])) {
include('./header.inc.php');
}
require_once('./header.inc.php');
//PMA_mysqlDie($conn_error, $local_query, FALSE);
PMA_mysqlDie($conn_error, '', FALSE);
} // end if
@@ -1075,9 +1051,8 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
$dbh = $userlink;
}
// Runs the "defines.lib.php" for the second time to get the mysql
// release number
include('./libraries/defines.lib.php');
// Gets the mysql release number
require_once('./libraries/defines_mysql.lib.php');
// if 'only_db' is set for the current user, there is no need to check for
// available databases in the "mysql" db
@@ -1322,7 +1297,9 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url);
$showtable = PMA_mysql_fetch_array($result);
$num = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
if ($num < $cfg['MaxExactCount']) unset($num);
if ($num < $cfg['MaxExactCount']) {
unset($num);
}
mysql_free_result($result);
if (!isset($num)) {
@@ -1908,7 +1885,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
}
}
if ($found_error) {
include('./libraries/header_meta_style.inc.php');
require_once('./libraries/header_meta_style.inc.php');
echo '</head><body><p>' . $error_message . '</p></body></html>';
if ($die) {
exit();
@@ -1921,7 +1898,7 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
if (@function_exists('mb_convert_encoding')
&& strpos(' ' . $lang, 'ja-')
&& file_exists('./libraries/kanji-encoding.lib.php')) {
include('./libraries/kanji-encoding.lib.php');
require_once('./libraries/kanji-encoding.lib.php');
define('PMA_MULTIBYTE_ENCODING', 1);
} // end if
@@ -1936,16 +1913,21 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
* @author Michal Cihar (nijel@users.sourceforge.net)
*/
function PMA_checkFileExtensions($file, $extension) {
if (substr($file, -1 * strlen($extension)) == $extension) return TRUE;
if (substr($file, -1 * strlen($extension)) == $extension) {
return TRUE;
}
if ($GLOBALS['cfg']['GZipDump'] && @function_exists('gzopen')) {
if (substr($file, -3 - strlen($extension)) == $extension . '.gz') return TRUE;
if (substr($file, -3 - strlen($extension)) == $extension . '.gz') {
return TRUE;
}
}
if ($GLOBALS['cfg']['BZipDump'] && @function_exists('bzdecompress')) {
if (substr($file, -4 - strlen($extension)) == $extension . '.bz2') return TRUE;
if (substr($file, -4 - strlen($extension)) == $extension . '.bz2') {
return TRUE;
}
}
return FALSE;
} // end function
} // end if: minimal common.lib needed?
} // $__PMA_COMMON_LIB__
?>

View File

@@ -35,17 +35,16 @@
* the same order of directives here as you do in config.inc.php.
*
* After having done all this, search libraries/common.lib.php for the
* following paragraph (x is an integer):
* following paragraph (x and y are integers):
*
* if (!isset($cfg['FileRevision']) || (int) substr($cfg['FileRevision'], 13, 3) < x) {
* include('./libraries/config_import.lib.php');
* if ($cfg['FileRevision'][0] < x || $cfg['FileRevision'][1] < y) {
* require_once('./libraries/config_import.lib.php');
* }
*
* Finally, set x to the _new_ revision number of config.inc.php
* (without '1.': 234 instead of 1.234) and you're done!
* Finally, set x and y to the _new_ revision number of config.inc.php and
* you're done! x would be the major version, y the minor version number of the
* new revision, e.g. 2.34 becomes: x = 2, y = 34
*/
if (!defined('PMA_CONFIG_IMPORT_LIB_INCLUDED')) {
define('PMA_CONFIG_IMPORT_LIB_INCLUDED', 1);
if (!isset($cfg['PmaAbsoluteUri'])) {
if (isset($cfgPmaAbsoluteUri)) {
@@ -98,8 +97,7 @@ if (!defined('PMA_CONFIG_IMPORT_LIB_INCLUDED')) {
if (!isset($cfg['Servers'][$i]['controluser']) && isset($cfg['Servers'][$i]['stduser'])) {
$cfg['Servers'][$i]['controluser'] = $cfg['Servers'][$i]['stduser'];
$cfg['Servers'][$i]['controlpass'] = $cfg['Servers'][$i]['stdpass'];
unset($cfg['Servers'][$i]['stduser']);
unset($cfg['Servers'][$i]['stdpass']);
unset($cfg['Servers'][$i]['stduser'], $cfg['Servers'][$i]['stdpass']);
} else if (!isset($cfg['Servers'][$i]['controluser'])) {
$cfg['Servers'][$i]['controluser'] = $cfg['Servers'][$i]['controlpass'] = '';
}
@@ -1270,6 +1268,4 @@ if (!defined('PMA_CONFIG_IMPORT_LIB_INCLUDED')) {
$cfg['Export']['sql_mime'] = FALSE;
}
} // $__PMA_CONFIG_IMPORT_LIB__
?>

View File

@@ -8,9 +8,6 @@
* May 19, 2002
*/
if (!defined('PMA_DB_CONFIG_LIB_INCLUDED')) {
define('PMA_DB_CONFIG_LIB_INCLUDED', 1);
/**
* Converts attributes of an object to xml code
*
@@ -92,4 +89,4 @@ if (!defined('PMA_DB_CONFIG_LIB_INCLUDED')) {
'RepeatCells'
);
} // $__PMA_DB_CONFIG_LIB__
?>

View File

@@ -16,7 +16,7 @@ if (!isset($is_db) || !$is_db) {
if (!isset($is_transformation_wrapper)) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php?' . PMA_generate_common_url('', '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
}
exit();
exit;
}
} // end if (ensures db exists)
if (!isset($is_table) || !$is_table) {
@@ -29,7 +29,7 @@ if (!isset($is_table) || !$is_table) {
if (!isset($is_transformation_wrapper)) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'db_details.php?' . PMA_generate_common_url($db, '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
}
exit();
exit;
} else if (isset($is_table)) {
mysql_free_result($is_table);
}

View File

@@ -2,9 +2,6 @@
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_DBG_PROFILING_INCLUDED')) {
define('PMA_DBG_PROFILING_INCLUDED', 1);
if (isset($GLOBALS['DBG']) && $GLOBALS['DBG']
&& isset($GLOBALS['cfg']['DBG']['profile']['enable'])
&& $GLOBALS['cfg']['DBG']['profile']['enable']) {
@@ -84,6 +81,5 @@ if (!defined('PMA_DBG_PROFILING_INCLUDED')) {
echo "</tbody></table>";
}
}
}
?>

View File

@@ -2,9 +2,6 @@
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_DBG_SETUP_INCLUDED')) {
define('PMA_DBG_SETUP_INCLUDED', 1);
if (isset($GLOBALS['cfg']['DBG']['enable']) && $GLOBALS['cfg']['DBG']['enable']) {
/**
* Loads the DBG extension if needed
@@ -15,10 +12,9 @@ if (!defined('PMA_DBG_SETUP_INCLUDED')) {
if (!@extension_loaded('dbg')) {
echo sprintf($strCantLoad, 'DBG') . '<br />' . "\n"
. '<a href="./Documentation.html#faqdbg" target="documentation">' . $GLOBALS['strDocu'] . '</a>' . "\n";
exit();
require_once('./footer.inc.php');
}
$GLOBALS['DBG'] = true;
}
}
?>

View File

@@ -5,54 +5,137 @@
/**
* DEFINES VARIABLES & CONSTANTS
* Overview:
* PMA_MYSQL_INT_VERSION (int) - eg: 32339 instead of 3.23.39
* PMA_VERSION (string) - phpMyAdmin version string
* PMA_PHP_INT_VERSION (int) - eg: 30017 instead of 3.0.17 or
* 40006 instead of 4.0.6RC3
* PMA_MYSQL_CLIENT_API (int) - the version number of the MySQL client
* API which php is built against.
* PMA_IS_WINDOWS (bool) - mark if phpMyAdmin running on windows
* server
* PMA_IS_GD2 (bool) - true is GD2 is present
* PMA_USR_OS (string) - the plateform (os) of the user
* PMA_USR_BROWSER_AGENT (string) - the browser of the user
* PMA_USR_BROWSER_VER (double) - the version of this browser
*/
// phpMyAdmin release
if (!defined('PMA_VERSION')) {
define('PMA_VERSION', '2.5.5-dev');
}
// MySQL Version
if (!defined('PMA_MYSQL_INT_VERSION') && isset($userlink)) {
if (!empty($server)) {
$result = PMA_mysql_query('SELECT VERSION() AS version');
if ($result != FALSE && @mysql_num_rows($result) > 0) {
$row = PMA_mysql_fetch_array($result);
$match = explode('.', $row['version']);
} else {
$result = @PMA_mysql_query('SHOW VARIABLES LIKE \'version\'');
if ($result != FALSE && @mysql_num_rows($result) > 0){
$row = PMA_mysql_fetch_row($result);
$match = explode('.', $row[1]);
}
}
} // end server id is defined case
if (!isset($match) || !isset($match[0])) {
$match[0] = 3;
}
if (!isset($match[1])) {
$match[1] = 21;
// php version
if (!defined('PMA_PHP_INT_VERSION')) {
if (!preg_match('@([0-9]{1,2}).([0-9]{1,2}).([0-9]{1,2})@', phpversion(), $match)) {
$result = preg_match('@([0-9]{1,2}).([0-9]{1,2})@', phpversion(), $match);
}
if (isset($match) && !empty($match[1])) {
if (!isset($match[2])) {
$match[2] = 0;
}
if(!isset($row)) {
$row['version'] = '3.21.0';
if (!isset($match[3])) {
$match[3] = 0;
}
define('PMA_MYSQL_INT_VERSION', (int)sprintf('%d%02d%02d', $match[0], $match[1], intval($match[2])));
define('PMA_MYSQL_STR_VERSION', $row['version']);
define('PMA_PHP_INT_VERSION', (int)sprintf('%d%02d%02d', $match[1], $match[2], $match[3]));
unset($match);
} else {
define('PMA_PHP_INT_VERSION', 0);
}
define('PMA_PHP_STR_VERSION', phpversion());
}
// MySQL client API
if (!defined('PMA_MYSQL_CLIENT_API')) {
$client_api = explode('.', mysql_get_client_info());
define('PMA_MYSQL_CLIENT_API', (int)sprintf('%d%02d%02d', $client_api[0], $client_api[1], intval($client_api[2])));
unset($client_api);
}
// Whether the os php is running on is windows or not
if (!defined('PMA_IS_WINDOWS')) {
if (defined('PHP_OS') && stristr(PHP_OS, 'win')) {
define('PMA_IS_WINDOWS', 1);
} else {
define('PMA_IS_WINDOWS', 0);
}
}
function PMA_dl($module) {
if (!isset($GLOBALS['PMA_dl_allowed'])) {
if (!@ini_get('safe_mode') && @ini_get('enable_dl') && @function_exists('dl')) {
ob_start();
phpinfo(INFO_GENERAL); /* Only general info */
$a = strip_tags(ob_get_contents());
ob_end_clean();
/* Get GD version string from phpinfo output */
if (preg_match('@Thread Safety[[:space:]]*enabled@', $a)) {
if (preg_match('@Server API[[:space:]]*\(CGI\|CLI\)@', $a)) {
$GLOBALS['PMA_dl_allowed'] = TRUE;
} else {
$GLOBALS['PMA_dl_allowed'] = FALSE;
}
} else {
$GLOBALS['PMA_dl_allowed'] = TRUE;
}
} else {
$GLOBALS['PMA_dl_allowed'] = FALSE;
}
}
if (PMA_IS_WINDOWS) {
$suffix = '.dll';
} else {
$suffix = '.so';
}
if ($GLOBALS['PMA_dl_allowed']) {
return @dl($module . $suffix);
} else {
return FALSE;
}
}
// Whether GD2 is present
if (!defined('PMA_IS_GD2')) {
if ($cfg['GD2Available'] == 'yes') {
define('PMA_IS_GD2', 1);
} elseif ($cfg['GD2Available'] == 'no') {
define('PMA_IS_GD2', 0);
} else {
if (!@extension_loaded('gd')) {
PMA_dl('gd');
}
if (!@function_exists('imagecreatetruecolor')) {
define('PMA_IS_GD2', 0);
} else {
if (@function_exists('gd_info')) {
$gd_nfo = gd_info();
if (strstr($gd_nfo["GD Version"], '2.')) {
define('PMA_IS_GD2', 1);
} else {
define('PMA_IS_GD2', 0);
}
} else {
/* We must do hard way... */
ob_start();
phpinfo(INFO_MODULES); /* Only modules */
$a = strip_tags(ob_get_contents());
ob_end_clean();
/* Get GD version string from phpinfo output */
if (preg_match('@GD Version[[:space:]]*\(.*\)@', $a, $v)) {
if (strstr($v, '2.')) {
define('PMA_IS_GD2', 1);
} else {
define('PMA_IS_GD2', 0);
}
} else {
define('PMA_IS_GD2', 0);
}
}
}
}
}
// Determines platform (OS), browser and version of the user
// Based on a phpBuilder article:
// see http://www.phpbuilder.net/columns/tim20000821.php
if (!defined('PMA_USR_OS')) {
// loic1 - 2001/25/11: use the new globals arrays defined with
// php 4.1+
if (!empty($_SERVER['HTTP_USER_AGENT'])) {
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
} else if (!isset($HTTP_USER_AGENT)) {
@@ -103,5 +186,6 @@ if (!defined('PMA_USR_OS')) {
define('PMA_USR_BROWSER_VER', 0);
define('PMA_USR_BROWSER_AGENT', 'OTHER');
}
} // $__PMA_DEFINES_LIB__
}
?>

View File

@@ -0,0 +1,40 @@
<?php
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* DEFINES MYSQL RELATED VARIABLES & CONSTANTS
* Overview:
* PMA_MYSQL_INT_VERSION (int) - eg: 32339 instead of 3.23.39
*/
if (!defined('PMA_MYSQL_INT_VERSION') && isset($userlink)) {
if (!empty($server)) {
$result = PMA_mysql_query('SELECT VERSION() AS version', $userlink);
if ($result != FALSE && @mysql_num_rows($result) > 0) {
$row = PMA_mysql_fetch_array($result);
$match = explode('.', $row['version']);
mysql_free_result($result);
}
} // end server id is defined case
if (!isset($match) || !isset($match[0])) {
$match[0] = 3;
}
if (!isset($match[1])) {
$match[1] = 23;
}
if (!isset($match[2])) {
$match[2] = 32;
}
if(!isset($row)) {
$row['version'] = '3.23.32';
}
define('PMA_MYSQL_INT_VERSION', (int)sprintf('%d%02d%02d', $match[0], $match[1], intval($match[2])));
define('PMA_MYSQL_STR_VERSION', $row['version']);
unset($result, $row, $match);
}
?>

View File

@@ -1,132 +0,0 @@
<?php
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* DEFINES VARIABLES & CONSTANTS
* Overview:
* PMA_VERSION (string) - phpMyAdmin version string
* PMA_PHP_INT_VERSION (int) - eg: 30017 instead of 3.0.17 or
* 40006 instead of 4.0.6RC3
* PMA_MYSQL_CLIENT_API (int) - the version number of the MySQL client
* API which php is built against.
* PMA_IS_WINDOWS (bool) - mark if phpMyAdmin running on windows
* server
* PMA_IS_GD2 (bool) - true is GD2 is present
*/
// phpMyAdmin release
if (!defined('PMA_VERSION')) {
define('PMA_VERSION', '2.5.5-dev');
}
// php version
if (!defined('PMA_PHP_INT_VERSION')) {
if (!preg_match('@([0-9]{1,2}).([0-9]{1,2}).([0-9]{1,2})@', phpversion(), $match)) {
$result = preg_match('@([0-9]{1,2}).([0-9]{1,2})@', phpversion(), $match);
}
if (isset($match) && !empty($match[1])) {
if (!isset($match[2])) {
$match[2] = 0;
}
if (!isset($match[3])) {
$match[3] = 0;
}
define('PMA_PHP_INT_VERSION', (int)sprintf('%d%02d%02d', $match[1], $match[2], $match[3]));
unset($match);
} else {
define('PMA_PHP_INT_VERSION', 0);
}
define('PMA_PHP_STR_VERSION', phpversion());
}
// MySQL client API
if (!defined('PMA_MYSQL_CLIENT_API')) {
$client_api = explode('.', mysql_get_client_info());
define('PMA_MYSQL_CLIENT_API', (int)sprintf('%d%02d%02d', $client_api[0], $client_api[1], intval($client_api[2])));
unset($client_api);
}
// Whether the os php is running on is windows or not
if (!defined('PMA_IS_WINDOWS')) {
if (defined('PHP_OS') && stristr(PHP_OS, 'win')) {
define('PMA_IS_WINDOWS', 1);
} else {
define('PMA_IS_WINDOWS', 0);
}
}
function PMA_dl($module) {
if (!isset($GLOBALS['PMA_dl_allowed'])) {
if (!@ini_get('safe_mode') && @ini_get('enable_dl') && @function_exists('dl')) {
ob_start();
phpinfo(INFO_GENERAL); /* Only general info */
$a = strip_tags(ob_get_contents());
ob_end_clean();
/* Get GD version string from phpinfo output */
if (preg_match('@Thread Safety[[:space:]]*enabled@', $a)) {
if (preg_match('@Server API[[:space:]]*\(CGI\|CLI\)@', $a)) {
$GLOBALS['PMA_dl_allowed'] = TRUE;
} else {
$GLOBALS['PMA_dl_allowed'] = FALSE;
}
} else {
$GLOBALS['PMA_dl_allowed'] = TRUE;
}
} else {
$GLOBALS['PMA_dl_allowed'] = FALSE;
}
}
if (PMA_IS_WINDOWS) {
$suffix = '.dll';
} else {
$suffix = '.so';
}
if ($GLOBALS['PMA_dl_allowed']) {
return @dl($module . $suffix);
} else {
return FALSE;
}
}
// Whether GD2 is present
if (!defined('PMA_IS_GD2')) {
if ($cfg['GD2Available'] == 'yes') {
define('PMA_IS_GD2', 1);
} elseif ($cfg['GD2Available'] == 'no') {
define('PMA_IS_GD2', 0);
} else {
if (!@extension_loaded('gd')) {
PMA_dl('gd');
}
if (!@function_exists('imagecreatetruecolor')) {
define('PMA_IS_GD2', 0);
} else {
if (@function_exists('gd_info')) {
$gd_nfo = gd_info();
if (strstr($gd_nfo["GD Version"], '2.')) {
define('PMA_IS_GD2', 1);
} else {
define('PMA_IS_GD2', 0);
}
} else {
/* We must do hard way... */
ob_start();
phpinfo(INFO_MODULES); /* Only modules */
$a = strip_tags(ob_get_contents());
ob_end_clean();
/* Get GD version string from phpinfo output */
if (preg_match('@GD Version[[:space:]]*\(.*\)@', $a, $v)) {
if (strstr($v, '2.')) {
define('PMA_IS_GD2', 1);
} else {
define('PMA_IS_GD2', 0);
}
} else {
define('PMA_IS_GD2', 0);
}
}
}
}
}
// $__PMA_DEFINES_PHP_LIB__
?>

View File

@@ -3,7 +3,7 @@
// vim: expandtab sw=4 ts=4 sts=4:
// Get relations & co. status
require('./libraries/relation.lib.php');
require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam();
function PMA_exportCheckboxCheck($str) {

View File

@@ -6,9 +6,6 @@
* Set of functions used to display the records returned by a sql query
*/
if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
define('PMA_DISPLAY_TBL_LIB_INCLUDED', 1);
/**
* Defines the display mode to use for the results of a sql query
*
@@ -700,7 +697,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
}
if ($GLOBALS['cfgRelation']['commwork'] && $GLOBALS['cfgRelation']['mimework'] && $GLOBALS['cfg']['BrowseMIME']) {
require('./libraries/transformations.lib.php');
require_once('./libraries/transformations.lib.php');
$GLOBALS['mime_map'] = PMA_getMIME($db, $table);
}
@@ -1208,7 +1205,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
// 1.3 Displays the links at left if required
if ($GLOBALS['cfg']['ModifyDeleteAtLeft']
&& ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped')) {
include('./libraries/display_tbl_links.lib.php');
require('./libraries/display_tbl_links.lib.php');
} // end if (1.3)
echo (($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') ? "\n" : '');
} // end if (1)
@@ -1242,7 +1239,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
if (file_exists('./libraries/transformations/' . $include_file)) {
$transformfunction_name = preg_replace('@(\.inc\.php3?)$@i', '', $GLOBALS['mime_map'][$meta->name]['transformation']);
include('./libraries/transformations/' . $include_file);
require_once('./libraries/transformations/' . $include_file);
if (defined('PMA_TRANSFORMATION_' . strtoupper($transformfunction_name)) && function_exists('PMA_transformation_' . $transformfunction_name)) {
$transform_function = 'PMA_transformation_' . $transformfunction_name;
@@ -1470,7 +1467,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
// 3. Displays the modify/delete links on the right if required
if ($GLOBALS['cfg']['ModifyDeleteAtRight']
&& ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped')) {
include('./libraries/display_tbl_links.lib.php');
require('./libraries/display_tbl_links.lib.php');
} // end if (3)
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
@@ -1899,5 +1896,4 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
return $buffer;
}
} // $__PMA_DISPLAY_TBL_LIB__
?>

View File

@@ -3,19 +3,19 @@
// vim: expandtab sw=4 ts=4 sts=4:
if (!empty($del_url)) {
echo ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n";
echo ' <input type="checkbox" name="rows_to_delete[]" value="' . $del_query . '" />' . "\n";
echo ' </td>' . "\n";
echo ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n"
. ' <input type="checkbox" name="rows_to_delete[]" value="' . $del_query . '" />' . "\n"
. ' </td>' . "\n";
}
if (!empty($edit_url)) {
echo ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n";
echo PMA_linkOrButton($edit_url, $edit_str, '');
echo $bookmark_go;
echo ' </td>' . "\n";
echo ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n"
. PMA_linkOrButton($edit_url, $edit_str, '')
. $bookmark_go
. ' </td>' . "\n";
}
if (!empty($del_url)) {
echo ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n";
echo PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : ''));
echo ' </td>' . "\n";
echo ' <td align="center" valign="' . ($bookmark_go != '' ? 'top' : 'middle') . '" bgcolor="' . $bgcolor . '">' . "\n"
. PMA_linkOrButton($del_url, $del_str, (isset($js_conf) ? $js_conf : ''))
. ' </td>' . "\n";
}
?>

View File

@@ -8,9 +8,6 @@
* Thanks to <markus@noga.de>
*/
// lem9
//if (!defined('PMA_GET_FOREIGN_LIB_INCLUDED')) {
// define('PMA_GET_FOREIGN_LIB_INCLUDED', 1);
// lem9: we always show the foreign field in the drop-down; if a display
// field is defined, we show it besides the foreign field
@@ -47,5 +44,4 @@
}
} // end if $foreigners
//} // $__PMA_GET_FOREIGN_LIB_INCLUDED__
?>

View File

@@ -5,13 +5,12 @@
/**
* This library grabs the names and values of the variables sent or posted to a
* script in the '$HTTP_*_VARS' / $_* arrays and sets simple globals variables
* from them. It does the same work for the $PHP_SELF variable.
* script in the $_* arrays and sets simple globals variables from them. It does
* the same work for the $PHP_SELF, $HTTP_ACCEPT_LANGUAGE and
* $HTTP_AUTHORIZATION variables.
*
* loic1 - 2001/25/11: use the new globals arrays defined with php 4.1+
*/
if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
define('PMA_GRAB_GLOBALS_INCLUDED', 1);
function PMA_gpc_extract($array, &$target) {
if (!is_array($array)) {
@@ -50,15 +49,15 @@ if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
} // end if
if (!empty($_SERVER)) {
if (isset($_SERVER['PHP_SELF'])) {
$PHP_SELF = $_SERVER['PHP_SELF'];
$server_vars = array('PHP_SELF', 'HTTP_ACCEPT_LANGUAGE', 'HTTP_AUTHORIZATION');
foreach ($server_vars as $current) {
if (isset($_SERVER[$current])) {
$$current = $_SERVER[$current];
} elseif (!isset($$current)) {
$$current = '';
}
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$HTTP_ACCEPT_LANGUAGE = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
}
if (isset($_SERVER['HTTP_AUTHORIZATION'])) {
$HTTP_AUTHORIZATION = $_SERVER['HTTP_AUTHORIZATION'];
}
unset($server_vars, $current);
} // end if
// Security fix: disallow accessing serious server files via "?goto="
@@ -66,5 +65,4 @@ if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
unset($goto);
} // end if
} // $__PMA_GRAB_GLOBALS_LIB__
?>

View File

@@ -8,9 +8,6 @@
*/
if (!defined('PMA_ALLOW_DENY_LIB_INCLUDED')) {
define('PMA_ALLOW_DENY_LIB_INCLUDED', 1);
/**
* Gets the "true" IP address of the current user
*
@@ -294,5 +291,4 @@ if (!defined('PMA_ALLOW_DENY_LIB_INCLUDED')) {
return FALSE;
} // end of the "PMA_AllowDeny()" function
} // $__PMA_ALLOW_DENY_LIB__
?>

View File

@@ -12,8 +12,6 @@
*
* 2002/2/22 - by Yukihiro Kawada <kawada@den.fujifilm.co.jp>
*/
if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
define('PMA_ENCODING_LIB_INCLUDED', 1);
/**
* Gets the php internal encoding codes and sets the available encoding
@@ -148,5 +146,4 @@ if (!defined('PMA_ENCODING_LIB_INCLUDED')) {
PMA_internal_enc_check();
} // $__PMA_ENCODING_LIB_INCLUDED
?>

View File

@@ -2,8 +2,7 @@
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_MYSQL_CHARSETS_LIB_INCLUDED')){
define('PMA_MYSQL_CHARSETS_LIB_INCLUDED', 1);
if (PMA_MYSQL_INT_VERSION >= 40100){
$res = PMA_mysql_query('SHOW CHARACTER SET;', $userlink)
or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW CHARACTER SET;');
@@ -15,8 +14,7 @@ if (!defined('PMA_MYSQL_CHARSETS_LIB_INCLUDED')){
$mysql_charsets_descriptions[$row['Charset']] = $row['Description'];
}
@mysql_free_result($res);
unset($res);
unset($row);
unset($res, $row);
$res = PMA_mysql_query('SHOW COLLATION;', $userlink)
or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW COLLATION;');
@@ -44,8 +42,7 @@ if (!defined('PMA_MYSQL_CHARSETS_LIB_INCLUDED')){
}
@mysql_free_result($res);
unset($res);
unset($row);
unset($res, $row);
function PMA_getCollationDescr($collation) {
if ($collation == 'binary') {
@@ -205,6 +202,6 @@ if (!defined('PMA_MYSQL_CHARSETS_LIB_INCLUDED')){
return $descr;
}
} // $__PMA_MYSQL_CHARSETS_LIB__
}
?>

View File

@@ -9,10 +9,6 @@
*/
if (!defined('PMA_MYSQL_WRAPPERS_LIB_INCLUDED')){
define('PMA_MYSQL_WRAPPERS_LIB_INCLUDED', 1);
function PMA_mysql_dbname($result, $row, $field = FALSE) {
if ($field != FALSE) {
return PMA_convert_display_charset(mysql_dbname($result, $row, $field));
@@ -173,6 +169,4 @@ if (!defined('PMA_MYSQL_WRAPPERS_LIB_INCLUDED')){
return PMA_convert_display_charset(mysql_tablename($result, $i));
}
} // PMA_MYSQL_WRAPPERS_LIB_INCLUDED
?>

View File

@@ -3,16 +3,15 @@
// vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_OB_LIB_INCLUDED')) {
define('PMA_OB_LIB_INCLUDED', 1);
# Output buffer functions for phpMyAdmin
#
# Copyright 2001 Jeremy Brand <jeremy@nirvani.net>
# http://www.jeremybrand.com/Jeremy/Brand/Jeremy_Brand.html
#
# Check for all the needed functions for output buffering
# Make some wrappers for the top and bottoms of our files.
/**
* Output buffer functions for phpMyAdmin
*
* Copyright 2001 Jeremy Brand <jeremy@nirvani.net>
* http://www.jeremybrand.com/Jeremy/Brand/Jeremy_Brand.html
*
* Check for all the needed functions for output buffering
* Make some wrappers for the top and bottoms of our files.
*/
/**
* This function be used eventually to support more modes. It is needed
@@ -128,6 +127,4 @@ if (!defined('PMA_OB_LIB_INCLUDED')) {
return $retval;
} // end of the 'PMA_outBufferPost()' function
} // $__PMA_OB_LIB__
?>

View File

@@ -2,9 +2,6 @@
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_READ_DUMP_INCLUDED')) {
define('PMA_READ_DUMP_INCLUDED', 1);
/**
* Removes comment lines and splits up large sql files into individual queries
*
@@ -210,6 +207,5 @@ if (!defined('PMA_READ_DUMP_INCLUDED')) {
}
return $content;
}
} // $__PMA_READ_DUMP_LIB__
?>

View File

@@ -7,9 +7,6 @@
*/
if (!defined('PMA_RELATION_LIB_INCLUDED')){
define('PMA_RELATION_LIB_INCLUDED', 1);
/**
* Executes a query as controluser if possible, otherwise as normal user
*
@@ -648,5 +645,4 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
return $ret;
} // end of 'PMA_foreignDropdown()' function
} // $__PMA_RELATION_LIB__
?>

View File

@@ -7,10 +7,7 @@
*/
if (!defined('PMA_RELATION_CLEANUP_LIB_INCLUDED')){
define('PMA_RELATION_CLEANUP_LIB_INCLUDED', 1);
include('./libraries/relation.lib.php');
require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam();
function PMA_relationsCleanupColumn($db, $table, $column) {
@@ -141,5 +138,4 @@ if (!defined('PMA_RELATION_CLEANUP_LIB_INCLUDED')){
}
}
} // $__PMA_RELATION_CLEANUP_LIB__
?>

View File

@@ -8,9 +8,11 @@
*/
/**
* We need some elements of the superglobal $_SERVER array.
*/
require_once('./libraries/grab_globals.lib.php');
if (!defined('PMA_SELECT_LANG_LIB_INCLUDED')) {
define('PMA_SELECT_LANG_LIB_INCLUDED', 1);
/**
* Define the path to the translations directory and get some variables
@@ -151,9 +153,6 @@ if (!defined('PMA_SELECT_LANG_LIB_INCLUDED')) {
);
if (!defined('PMA_IS_LANG_DETECT_FUNCTION')) {
define('PMA_IS_LANG_DETECT_FUNCTION', 1);
/**
* Analyzes some PHP environment variables to find the most probable language
* that should be used
@@ -182,20 +181,6 @@ if (!defined('PMA_SELECT_LANG_LIB_INCLUDED')) {
}
} // end of the 'PMA_langDetect()' function
} // end if
/**
* Get some global variables if 'register_globals' is set to 'off'
* loic1 - 2001/25/11: use the new globals arrays defined with php 4.1+
*/
if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$HTTP_ACCEPT_LANGUAGE = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
}
if (!empty($_SERVER['HTTP_USER_AGENT'])) {
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
}
if (!isset($lang)) {
if (isset($_GET) && !empty($_GET['lang'])) {
@@ -233,9 +218,7 @@ if (!defined('PMA_SELECT_LANG_LIB_INCLUDED')) {
$available_languages[$tmp_lang] = $tmp_lang_data;
}
} // end while
unset($tmp_lang);
unset($tmp_lang_data);
unset($available_language_files);
unset($tmp_lang, $tmp_lang_data, $available_language_files);
} // end if
// Lang forced
@@ -276,7 +259,6 @@ if (!defined('PMA_SELECT_LANG_LIB_INCLUDED')) {
// 5. Defines the associated filename and load the translation
$lang_file = $lang_path . $available_languages[$lang][1] . '.inc.php';
include('./' . $lang_file);
require_once('./' . $lang_file);
} // $__PMA_SELECT_LANG_LIB__
?>

View File

@@ -14,9 +14,6 @@
* (around 4.0.2) as well as the MySQL documentation.
*/
if (!defined('PMA_SQP_DATA_INCLUDED')) {
define('PMA_SQP_DATA_INCLUDED', 1);
$PMA_SQPdata_function_name = array (
'ABS',
'ACOS',
@@ -503,5 +500,4 @@ if (!defined('PMA_SQP_DATA_INCLUDED')) {
//$PMA_SQPdata_column_type_cnt = count($PMA_SQPdata_column_type);
$PMA_SQPdata_column_type_cnt = 43;
} // $__PMA_SQP_DATA__
?>

View File

@@ -31,9 +31,6 @@
*/
if (!defined('PMA_SQP_LIB_INCLUDED')) {
define('PMA_SQP_LIB_INCLUDED', 1);
/**
* Minimum inclusion? (i.e. for the stylesheet builder)
*/
@@ -46,16 +43,12 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
/**
* Include the string library as we use it heavily
*/
if (!defined('PMA_STR_LIB_INCLUDED')) {
include('./libraries/string.lib.php');
}
require_once('./libraries/string.lib.php');
/**
* Include data for the SQL Parser
*/
if (!defined('PMA_SQP_DATA_INCLUDED')) {
include('./libraries/sqlparser.data.php');
}
require_once('./libraries/sqlparser.data.php');
if (!defined('DEBUG_TIMING')) {
function PMA_SQP_arrayAdd(&$arr, $type, $data, &$arrsize)
@@ -2008,5 +2001,5 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) {
return PMA_SQP_formatNone($arr);
} // end of the "PMA_SQP_formatText()" function
} // end if: minimal common.lib needed?
} // $__PMA_SQP_LIB__
?>

View File

@@ -30,10 +30,7 @@
* @version $Id$
*/
if (!defined('PMA_SQL_VALIDATOR_CLASS_INCLUDED')) {
define('PMA_SQL_VALIDATOR_CLASS_INCLUDED', 1);
@include('SOAP/Client.php');
@include_once('SOAP/Client.php');
if (!function_exists('class_exists') || !class_exists('SOAP_Client')) {
$GLOBALS['sqlvalidator_error'] = TRUE;
@@ -411,6 +408,4 @@ if (!defined('PMA_SQL_VALIDATOR_CLASS_INCLUDED')) {
} // end else
} // $__PMA_SQL_VALIDATOR_CLASS__
?>

View File

@@ -32,16 +32,11 @@
*/
if (!defined('PMA_SQL_VALIDATOR_INCLUDED')) {
define('PMA_SQL_VALIDATOR_INCLUDED', 1);
// We need the PEAR libraries, so do a minimum version check first
// I'm not sure if PEAR was available before this point
// For now we actually use a configuration flag
if ($cfg['SQLValidator']['use'] == TRUE) {
// We cannot check && !defined(PMA_SQL_VALIDATOR_CLASS_INCLUDED))
// as it will produce a nasty warning message
include('./libraries/sqlvalidator.class.php');
require_once('./libraries/sqlvalidator.class.php');
} // if ($cfg['SQLValidator']['use'] == TRUE)
@@ -104,6 +99,4 @@ if (!defined('PMA_SQL_VALIDATOR_INCLUDED')) {
return $str;
} // end of the "PMA_validateSQL()" function
} // $__PMA_SQL_VALIDATOR__
?>

View File

@@ -16,9 +16,6 @@
*/
if (!defined('PMA_STR_LIB_INCLUDED')) {
define('PMA_STR_LIB_INCLUDED', 1);
// This is for handling input better
if (defined('PMA_MULTIBYTE_ENCODING')) {
$GLOBALS['PMA_strlen'] = 'mb_strlen';
@@ -320,6 +317,4 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
return $found;
} // end of the "PMA_STR_binarySearchInArr()" function
} // $__PMA_STR_LIB__
?>

View File

@@ -6,10 +6,6 @@
* Set of functions used with the relation and pdf feature
*/
if (!defined('PMA_TRANSFORMATION_LIB_INCLUDED')){
define('PMA_TRANSFORMATION_LIB_INCLUDED', 1);
function PMA_transformation_getOptions($string) {
$transform_options = array();
@@ -201,5 +197,4 @@ if (!defined('PMA_TRANSFORMATION_LIB_INCLUDED')){
return $include_file;
} // end of 'PMA_sanitizeTransformationFile()' function
} // $__PMA_TRANSFORMATION_LIB__
?>

View File

@@ -8,14 +8,11 @@
*
* For instructions, read the /Documentation.html file.
*
* The string ENTER_FILENAME_HERE shall be substituted with the filename without the '.inc.php'
* The string [ENTER_FILENAME_HERE] shall be substituted with the filename without the '.inc.php'
* extension. For further information regarding naming conventions see the /Documentation.html file.
*/
if (!defined('PMA_TRANSFORMATION_[ENTER_FILENAME_HERE]')){
define('PMA_TRANSFORMATION_[ENTER_FILENAME_HERE]', 1);
function PMA_transformation_[enter_filename_here]($buffer, $options = array(), $meta = '') {
function PMA_transformation_[ENTER_FILENAME_HERE]($buffer, $options = array(), $meta = '') {
// possibly use a global transform and feed it with special options:
// include('./libraries/transformations/global.inc.php');
@@ -27,4 +24,5 @@ if (!defined('PMA_TRANSFORMATION_[ENTER_FILENAME_HERE]')){
return $buffer;
}
}
?>

View File

@@ -23,9 +23,6 @@
*
*/
if (!defined('PMA_TRANSFORMATION_LIB_GLOBAL')){
define('PMA_TRANSFORMATION_LIB_GLOBAL', 1);
function PMA_transformation_global_plain($buffer, $options = array(), $meta = '') {
return htmlspecialchars($buffer);
}
@@ -47,4 +44,5 @@ if (!defined('PMA_TRANSFORMATION_LIB_GLOBAL')){
$return = str_replace("[__BUFFER__]", $buffer, $options['string']);
return $return;
}
}
?>

View File

@@ -2,9 +2,6 @@
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_TRANSFORMATION_IMAGE_JPEG__INLINE')){
define('PMA_TRANSFORMATION_IMAGE_JPEG__INLINE', 1);
function PMA_transformation_image_jpeg__inline($buffer, $options = array(), $meta = '') {
include('./libraries/transformations/global.inc.php');
@@ -17,4 +14,5 @@ if (!defined('PMA_TRANSFORMATION_IMAGE_JPEG__INLINE')){
return $buffer;
}
}
?>

View File

@@ -2,9 +2,6 @@
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_TRANSFORMATION_IMAGE_JPEG__LINK')){
define('PMA_TRANSFORMATION_IMAGE_JPEG__LINK', 1);
function PMA_transformation_image_jpeg__link($buffer, $options = array(), $meta = '') {
include('./libraries/transformations/global.inc.php');
@@ -13,4 +10,5 @@ if (!defined('PMA_TRANSFORMATION_IMAGE_JPEG__LINK')){
return $buffer;
}
}
?>

View File

@@ -2,9 +2,6 @@
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_TRANSFORMATION_IMAGE_PNG__INLINE')){
define('PMA_TRANSFORMATION_IMAGE_PNG__INLINE', 1);
function PMA_transformation_image_png__inline($buffer, $options = array(), $meta = '') {
include('./libraries/transformations/global.inc.php');
@@ -17,4 +14,5 @@ if (!defined('PMA_TRANSFORMATION_IMAGE_PNG__INLINE')){
return $buffer;
}
}
?>

View File

@@ -16,17 +16,11 @@ define('PMA_DISPLAY_HEADING', 0);
/**
* Gets some core libraries and displays a top message if required
*/
if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
include('./libraries/grab_globals.lib.php');
}
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
include('./libraries/common.lib.php');
}
require('./header.inc.php');
require('./libraries/relation.lib.php');
require('./libraries/transformations.lib.php');
require_once('./libraries/grab_globals.lib.php');
require_once('./libraries/common.lib.php');
require_once('./header.inc.php');
require_once('./libraries/relation.lib.php');
require_once('./libraries/transformations.lib.php');
$cfgRelation = PMA_getRelationsParam();
$types = PMA_getAvailableMIMEtypes();
@@ -78,5 +72,6 @@ foreach($types['transformation'] AS $key => $transform) {
* Displays the footer
*/
echo "\n";
require('./footer.inc.php');
require_once('./footer.inc.php');
?>

View File

@@ -2,9 +2,6 @@
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__DATEFORMAT')){
define('PMA_TRANSFORMATION_TEXT_PLAIN__DATEFORMAT', 1);
function PMA_transformation_text_plain__dateformat($buffer, $options = array(), $meta = '') {
// possibly use a global transform and feed it with special options:
// include('./libraries/transformations/global.inc.php');
@@ -58,6 +55,5 @@ if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__DATEFORMAT')){
return $buffer;
}
}
?>
?>

View File

@@ -2,9 +2,6 @@
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__EXTERNAL')){
define('PMA_TRANSFORMATION_TEXT_PLAIN__EXTERNAL', 1);
function PMA_EscapeShellArg($string, $prepend = '\'') {
return $prepend . ereg_replace("'", "'\\''", $string) . $prepend;
}
@@ -62,4 +59,5 @@ if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__EXTERNAL')){
return $retstring;
}
}
?>

View File

@@ -2,10 +2,8 @@
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__FORMATTED')){
define('PMA_TRANSFORMATION_TEXT_PLAIN__FORMATTED', 1);
function PMA_transformation_text_plain__formatted($buffer, $options = array(), $meta = '') {
return $buffer;
}
}
?>

View File

@@ -2,9 +2,6 @@
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__IMAGELINK')){
define('PMA_TRANSFORMATION_TEXT_PLAIN__IMAGELINK', 1);
function PMA_transformation_text_plain__imagelink($buffer, $options = array(), $meta = '') {
include('./libraries/transformations/global.inc.php');
@@ -12,4 +9,5 @@ if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__IMAGELINK')){
$buffer = PMA_transformation_global_html_replace($buffer, $transform_options);
return $buffer;
}
}
?>

View File

@@ -2,11 +2,8 @@
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__LINK')){
define('PMA_TRANSFORMATION_TEXT_PLAIN__LINK', 1);
function PMA_transformation_text_plain__link($buffer, $options = array(), $meta = '') {
include('./libraries/transformations/global.inc.php');
require_once('./libraries/transformations/global.inc.php');
// $transform_options = array ('string' => '<a href="' . (isset($options[0]) ? $options[0] : '') . '%1$s" title="' . (isset($options[1]) ? $options[1] : '%1$s') . '">' . (isset($options[1]) ? $options[1] : '%1$s') . '</a>');
@@ -17,4 +14,5 @@ if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__LINK')){
return $buffer;
}
}
?>

View File

@@ -2,9 +2,6 @@
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__SUBSTR')){
define('PMA_TRANSFORMATION_TEXT_PLAIN__SUBSTR', 1);
function PMA_transformation_text_plain__substr($buffer, $options = array(), $meta = '') {
// possibly use a global transform and feed it with special options:
// include('./libraries/transformations/global.inc.php');
@@ -43,4 +40,5 @@ if (!defined('PMA_TRANSFORMATION_TEXT_PLAIN__SUBSTR')){
return $newtext;
}
}
?>

View File

@@ -8,9 +8,6 @@
*/
if (!defined('PMA_URL_GENERATION_LIB_INCLUDED')){
define('PMA_URL_GENERATION_LIB_INCLUDED', 1);
/**
* Generates text with hidden inputs.
*
@@ -86,5 +83,5 @@ if (!defined('PMA_URL_GENERATION_LIB_INCLUDED')){
$result .= $amp . 'table='.urlencode($table);
return $result;
}
}
?>

View File

@@ -10,12 +10,8 @@ define('PMA_DISPLAY_HEADING', 0);
/**
* Gets some core libraries and displays a top message if required
*/
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');
// Puts the language to use in a cookie that will expire in 30 days
if (!isset($pma_uri_parts)) {
$pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']);
@@ -33,7 +29,7 @@ if (isset($table)) {
unset($table);
}
$show_query = '1';
require('./header.inc.php');
require_once('./header.inc.php');
if (isset($message)) {
PMA_showMessage($message);
}
@@ -254,8 +250,7 @@ if ($server > 0) {
} // end elseif
} // end if
} // end while
unset($show_grants_dbname);
unset($show_grants_str);
unset($show_grants_dbname, $show_grants_str);
mysql_free_result($rs_usr);
} // end if
} // end elseif
@@ -550,8 +545,8 @@ if (isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding']
} else {
$selected = '';
}
echo ' ';
echo '<option value="' . $tmpcharset . '"' . $selected . '>' . $tmpcharset . '</option>' . "\n";
echo ' '
. '<option value="' . $tmpcharset . '"' . $selected . '>' . $tmpcharset . '</option>' . "\n";
}
?>
</select>
@@ -634,20 +629,20 @@ if (PMA_PHP_INT_VERSION == 40203 && @extension_loaded('mbstring')) {
*/
if (PMA_PHP_INT_VERSION < 40100) {
echo '<p class="warning">' . sprintf($strUpgrade, 'PHP', '4.1.x') . '</p>' . "\n";
echo '<p class="warning">' . sprintf($strUpgrade, 'PHP', '4.1.0') . '</p>' . "\n";
}
/**
* Warning for old MySQL version
*/
if (PMA_MYSQL_INT_VERSION < 32336) {
echo '<p class="warning">' . sprintf($strUpgrade, 'MySQL', '3.23.36') . '</p>' . "\n";
if (PMA_MYSQL_INT_VERSION < 32332) {
echo '<p class="warning">' . sprintf($strUpgrade, 'MySQL', '3.23.32') . '</p>' . "\n";
}
/**
* Displays the footer
*/
echo "\n";
require('./footer.inc.php');
require_once('./footer.inc.php');
?>

View File

@@ -19,8 +19,7 @@ if (!empty($submit_mult)
$what = 'drop_db';
} else if (!empty($selected_tbl)) {
if ($submit_mult == $strPrintView) {
include('./tbl_printview.php');
exit();
require('./tbl_printview.php');
} else {
$selected = $selected_tbl;
switch ($submit_mult) {
@@ -60,8 +59,7 @@ if (!empty($submit_mult)
if ($submit_mult == $strDrop) {
$what = 'drop_fld';
} else {
include('./tbl_alter.php');
exit();
require('./tbl_alter.php');
}
} else {
$what = 'row_delete';
@@ -77,13 +75,13 @@ if (!empty($submit_mult) && !empty($what)) {
$js_to_run = 'functions.js';
unset($message);
if (!empty($table)) {
include('./tbl_properties_common.php');
require('./tbl_properties_common.php');
$url_query .= '&amp;goto=tbl_properties.php&amp;back=tbl_properties.php';
include('./tbl_properties_table_info.php');
require('./tbl_properties_table_info.php');
}
elseif (!empty($db)) {
include('./db_details_common.php');
include('./db_details_db_info.php');
require('./db_details_common.php');
require('./db_details_db_info.php');
}
// Builds the query
$full_query = '';
@@ -168,8 +166,7 @@ if (!empty($submit_mult) && !empty($what)) {
<?php
echo"\n";
include('./footer.inc.php');
exit();
require_once('./footer.inc.php');
} // end if
@@ -179,7 +176,7 @@ if (!empty($submit_mult) && !empty($what)) {
else if ($mult_btn == $strYes) {
if ($query_type == 'drop_db' || $query_type == 'drop_tbl' || $query_type == 'drop_fld') {
include('./libraries/relation_cleanup.lib.php');
require_once('./libraries/relation_cleanup.lib.php');
}
$sql_query = '';
@@ -268,8 +265,7 @@ else if ($mult_btn == $strYes) {
|| $query_type == 'analyze_tbl'
|| $query_type == 'check_tbl'
|| $query_type == 'optimize_tbl') {
include('./sql.php');
exit();
require('./sql.php');
}
}

View File

@@ -6,15 +6,15 @@
/**
* Gets some core libraries
*/
require('./libraries/grab_globals.lib.php');
require('./libraries/common.lib.php');
require('./db_details_common.php');
require_once('./libraries/grab_globals.lib.php');
require_once('./libraries/common.lib.php');
require_once('./db_details_common.php');
/**
* Settings for relation stuff
*/
require('./libraries/relation.lib.php');
require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam();
@@ -29,13 +29,13 @@ $cfgRelation = PMA_getRelationsParam();
if (!$cfgRelation['relwork']) {
echo sprintf($strNotSet, 'relation', 'config.inc.php') . '<br />' . "\n"
. '<a href="./Documentation.html#relation" target="documentation">' . $strDocu . '</a>' . "\n";
exit();
require_once('./footer.inc.php');
}
if (!$cfgRelation['displaywork']) {
echo sprintf($strNotSet, 'table_info', 'config.inc.php') . '<br />' . "\n"
. '<a href="./Documentation.html#table_info" target="documentation">' . $strDocu . '</a>' . "\n";
exit();
require_once('./footer.inc.php');
}
if (!isset($cfgRelation['table_coords'])){
@@ -525,5 +525,5 @@ ToggleDragDrop('pdflayout');
* Displays the footer
*/
echo "\n";
require('./footer.inc.php');
require_once('./footer.inc.php');
?>

View File

@@ -11,15 +11,15 @@
/**
* 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');
/**
* Settings for relation stuff
*/
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();
@@ -42,7 +42,7 @@ if (!$cfgRelation['pdfwork']) {
/**
* Gets the "fpdf" libraries and defines the pdf font path
*/
require('./libraries/fpdf/fpdf.php');
require_once('./libraries/fpdf/fpdf.php');
$FPDF_font_path = './libraries/fpdf/font/';
@@ -267,7 +267,7 @@ class PMA_PDF extends FPDF
global $server, $lang, $convcharset, $db;
global $charset, $text_dir, $strRunning, $strDatabase;
include('./header.inc.php');
require_once('./header.inc.php');
echo '<p><b>PDF - '. $GLOBALS['strError'] . '</b></p>' . "\n";
if (!empty($error_message)) {
@@ -281,8 +281,7 @@ class PMA_PDF extends FPDF
. '">' . $GLOBALS['strBack'] . '</a>';
echo "\n";
include('./footer.inc.php');
exit();
require_once('./footer.inc.php');
} // end of the "PMA_PDF_die()" function

View File

@@ -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');
/**

View File

@@ -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 (!empty($db)) {
$db_start = $db;
}
@@ -16,8 +16,8 @@ if (!empty($db)) {
/**
* 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) {
@@ -29,7 +29,7 @@ if ($cfg['OBGzip']) {
// 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

View File

@@ -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 (!empty($db)) {
$db_start = $db;
}
@@ -16,8 +16,8 @@ if (!empty($db)) {
/**
* 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) {
@@ -25,7 +25,7 @@ if ($cfg['OBGzip']) {
}
}
require('./libraries/relation.lib.php');
require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam();
/**
@@ -43,8 +43,8 @@ if ($server > 0) {
// 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');
?>
<script type="text/javascript" language="javascript">
@@ -219,7 +219,7 @@ if (!isset($goto)) {
$goto = '';
}
require './libraries/bookmark.lib.php';
require_once './libraries/bookmark.lib.php';
$is_inside_querywindow = TRUE;
require './tbl_query_box.php';

View File

@@ -5,9 +5,9 @@
/**
* Gets some core libraries
*/
require('./libraries/read_dump.lib.php');
require('./libraries/grab_globals.lib.php');
require('./libraries/common.lib.php');
require_once('./libraries/read_dump.lib.php');
require_once('./libraries/grab_globals.lib.php');
require_once('./libraries/common.lib.php');
if (!isset($db)) {
$db = '';
@@ -49,7 +49,7 @@ if (!empty($sql_localfile) && !empty($cfg['UploadDir'])) {
* Bookmark Support: get a query back from bookmark if required
*/
if (!empty($id_bookmark)) {
include('./libraries/bookmark.lib.php');
require_once('./libraries/bookmark.lib.php');
switch ($action_bookmark) {
case 0: // bookmarked query that have to be run
$sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], $id_bookmark);
@@ -150,7 +150,7 @@ if (!$cfg['AllowUserDropDatabase']
// loic1: optimized query
$result = @PMA_mysql_query('USE mysql');
if (PMA_mysql_error()) {
include('./header.inc.php');
require_once('./header.inc.php');
PMA_mysqlDie($strNoDropDatabases, '', '', $err_url);
}
}
@@ -160,7 +160,7 @@ define('PMA_CHK_DROP', 1);
* Store a query as a bookmark before executing it?
*/
if (isset($SQLbookmark) && $sql_query != '') {
include('./libraries/bookmark.lib.php');
require_once('./libraries/bookmark.lib.php');
$bfields = array(
'dbase' => $db,
'user' => $cfg['Bookmark']['user'],
@@ -239,8 +239,7 @@ if ($sql_query != '') {
if (preg_match('@^(DROP|CREATE)[[:space:]]+(IF EXISTS[[:space:]]+)?(TABLE|DATABASE)[[:space:]]+(.+)@i', $sql_query)) {
$reload = 1;
}
include('./sql.php');
exit();
require('./sql.php');
}
// Runs multiple queries
@@ -255,8 +254,7 @@ if ($sql_query != '') {
$complete_query = $sql_query;
$display_query = $sql_query;
$sql_query = $a_sql_query;
include('./sql.php');
exit();
require('./sql.php');
}
$result = PMA_mysql_query($a_sql_query);
@@ -320,7 +318,7 @@ if ($sql_query != '') {
*/
if (isset($my_die)) {
$js_to_run = 'functions.js';
include('./header.inc.php');
require_once('./header.inc.php');
if (is_array($my_die)) {
foreach($my_die AS $key => $die_string) {
PMA_mysqlDie('', $die_string, '', $err_url, FALSE);
@@ -387,7 +385,7 @@ if ($goto == 'db_details.php' || $goto == 'tbl_properties.php') {
$js_to_run = 'functions.js';
}
if ($goto != 'main.php') {
include('./header.inc.php');
require_once('./header.inc.php');
}
$active_page = $goto;
require('./' . $goto);

View File

@@ -64,7 +64,7 @@ cat <<END
Please ensure you have:
1. incremented rc count or version in CVS :
- in libraries/defines_php.lib.php the line
- in libraries/defines.lib.php the line
" define('PMA_VERSION', '$1'); "
- in Documentation.html the 2 lines
" <title>phpMyAdmin $1 - Documentation</title> "
@@ -177,7 +177,7 @@ Todo now:
phpmyadmin-news@lists.sourceforge.net
phpmyadmin-users@lists.sourceforge.net
8. increment rc count or version in CVS :
- in libraries/defines_php.lib.php the line
- in libraries/defines.lib.php the line
" define('PHPMYADMIN_VERSION', '2.2.2-rc1'); "
- in Documentation.html the 2 lines
" <title>phpMyAdmin 2.2.2-rc1 - Documentation</title> "

View File

@@ -28,15 +28,14 @@ echo '<h2>' . "\n"
*/
if (PMA_MYSQL_INT_VERSION < 40100) {
// TODO: Some nice Message :-)
include('./footer.inc.php');
exit;
require_once('./footer.inc.php');
}
/**
* Includes the required charset library
*/
require('./libraries/mysql_charsets.lib.php');
require_once('./libraries/mysql_charsets.lib.php');
/**
@@ -101,6 +100,6 @@ echo ' </table>' . "\n"
. ' </tr>' . "\n"
. '</table>' . "\n";
require('./footer.inc.php');
require_once('./footer.inc.php');
?>

View File

@@ -5,22 +5,13 @@
/**
* 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');
}
require_once('./libraries/grab_globals.lib.php');
require_once('./libraries/common.lib.php');
/**
* Handles some variables that may have been sent by the calling script
*/
if (isset($db)) {
unset($db);
}
if (isset($table)) {
unset($table);
}
unset($db, $table);
/**
* Set parameters for links
@@ -35,7 +26,7 @@ $err_url = 'main.php' . $url_query;
/**
* Displays the headers
*/
require('./header.inc.php');
require_once('./header.inc.php');
/**
* Checks for superuser privileges

View File

@@ -6,7 +6,7 @@
/**
* Checks if the left frame has to be reloaded
*/
require('./libraries/grab_globals.lib.php');
require_once('./libraries/grab_globals.lib.php');
/**
@@ -74,7 +74,7 @@ if ((!empty($drop_selected_dbs) || isset($query_type)) && ($is_superuser || $cfg
$action = 'server_databases.php';
$submit_mult = 'drop_db' ;
$err_url = 'server_databases.php?' . PMA_generate_common_url();
include('./mult_submits.inc.php');
require('./mult_submits.inc.php');
$message = sprintf($strDatabasesDropped, count($selected));
// we need to reload the database list now.
PMA_availableDatabases();
@@ -102,8 +102,7 @@ echo '<h2>' . "\n"
*/
if (!empty($dbstats) && !$is_superuser) {
echo $strNoPrivileges . "\n";
include('./footer.inc.php');
exit;
require_once('./footer.inc.php');
}
@@ -373,6 +372,6 @@ if (count($statistics) > 0) {
/**
* Sends the footer
*/
require('./footer.inc.php');
require_once('./footer.inc.php');
?>

View File

@@ -6,7 +6,7 @@
/**
* Checks if the left frame has to be reloaded
*/
require('./libraries/grab_globals.lib.php');
require_once('./libraries/grab_globals.lib.php');
/**
@@ -62,11 +62,11 @@ $multi_values .= '<br />
<br /><br />';
$export_type = 'server';
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 File

@@ -4,9 +4,7 @@
// Check parameters
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
include('./libraries/common.lib.php');
}
require_once('./libraries/common.lib.php');
PMA_checkParameters(array('is_superuser', 'url_query'));
/**

View File

@@ -27,13 +27,12 @@ if (!empty($pred_tablename)) {
* Checks if the user is allowed to do what he tries to...
*/
if (!$is_superuser) {
include('./server_links.inc.php');
require('./server_links.inc.php');
echo '<h2>' . "\n"
. ' ' . $strPrivileges . "\n"
. '</h2>' . "\n"
. $strNoPrivileges . "\n";
include('./footer.inc.php');
exit;
require_once('./footer.inc.php');
}
@@ -1021,8 +1020,7 @@ if (empty($adduser) && empty($checkprivs)) {
$res = PMA_mysql_query('SELECT "foo" FROM `user` WHERE `User` = "' . PMA_sqlAddslashes($username) . '" AND `Host` = "' . $hostname . '";', $userlink);
if (mysql_affected_rows($userlink) <= 0) {
echo $strUserNotFound;
include('./footer.inc.php');
exit;
require_once('./footer.inc.php');
}
mysql_free_result($res);
unset($res);
@@ -1427,6 +1425,6 @@ if (empty($adduser) && empty($checkprivs)) {
* Displays the footer
*/
echo "\n\n";
require('./footer.inc.php');
require_once('./footer.inc.php');
?>

View File

@@ -6,7 +6,7 @@
/**
* Does the common work
*/
require('./server_common.inc.php');
require_once('./server_common.inc.php');
/**
@@ -94,6 +94,6 @@ foreach($serverProcesses AS $name => $value) {
/**
* Sends the footer
*/
require('./footer.inc.php');
require_once('./footer.inc.php');
?>

View File

@@ -29,8 +29,7 @@ if (!empty($innodbstatus)) {
. htmlspecialchars($row[0]) . "\n"
. '</pre>' . "\n";
mysql_free_result($res);
include('./footer.inc.php');
exit;
require_once('./footer.inc.php');
}
/**
@@ -46,8 +45,7 @@ echo '<h2>' . "\n"
*/
if (!$is_superuser && !$cfg['ShowMysqlInfo']) {
echo $strNoPrivileges;
include('./footer.inc.php');
exit;
require_once('./footer.inc.php');
}
@@ -301,6 +299,6 @@ if ($res) {
/**
* Sends the footer
*/
require('./footer.inc.php');
require_once('./footer.inc.php');
?>

View File

@@ -28,8 +28,7 @@ echo '<h2>' . "\n"
*/
if (!$is_superuser && !$cfg['ShowMysqlVars']) {
echo $strNoPrivileges;
include('./footer.inc.php');
exit;
require_once('./footer.inc.php');
}
@@ -108,6 +107,6 @@ foreach ($serverVars as $name => $value) {
/**
* Sends the footer
*/
require('./footer.inc.php');
require_once('./footer.inc.php');
?>

38
sql.php
View File

@@ -5,8 +5,8 @@
/**
* Gets some core libraries
*/
require('./libraries/grab_globals.lib.php');
require('./libraries/common.lib.php');
require_once('./libraries/grab_globals.lib.php');
require_once('./libraries/common.lib.php');
/**
@@ -61,7 +61,7 @@ if (!defined('PMA_CHK_DROP')
// loic1: optimized query
$result = @PMA_mysql_query('USE mysql');
if (PMA_mysql_error()) {
include('./header.inc.php');
require_once('./header.inc.php');
PMA_mysqlDie($strNoDropDatabases, '', '', $err_url);
} // end if
} // end if
@@ -71,7 +71,7 @@ if (!defined('PMA_CHK_DROP')
* Bookmark add
*/
if (isset($store_bkm)) {
include('./libraries/bookmark.lib.php');
require_once('./libraries/bookmark.lib.php');
PMA_addBookmarks($fields, $cfg['Bookmark'], (isset($bkm_all_users) && $bkm_all_users == 'true' ? true : false));
header('Location: ' . $cfg['PmaAbsoluteUri'] . $goto);
} // end if
@@ -151,7 +151,7 @@ if (isset($btnDrop) && $btnDrop == $strNo) {
unset($table);
}
$active_page = $goto;
include('./' . preg_replace('@\.\.*@', '.', $goto));
require('./' . preg_replace('@\.\.*@', '.', $goto));
} else {
header('Location: ' . $cfg['PmaAbsoluteUri'] . str_replace('&amp;', '&', $goto));
}
@@ -187,7 +187,7 @@ if (!$cfg['Confirm']
if ($do_confirm) {
$stripped_sql_query = $sql_query;
include('./header.inc.php');
require_once('./header.inc.php');
echo $strDoYouReally . '&nbsp;:<br />' . "\n";
echo '<tt>' . htmlspecialchars($stripped_sql_query) . '</tt>&nbsp;?<br/>' . "\n";
?>
@@ -324,7 +324,7 @@ else {
// Displays an error message if required and stop parsing the script
if (PMA_mysql_error()) {
$error = PMA_mysql_error();
include('./header.inc.php');
require_once('./header.inc.php');
$full_err_url = (preg_match('@^(db_details|tbl_properties)@', $err_url))
? $err_url . '&amp;show_query=1&amp;sql_query=' . urlencode($sql_query)
: $err_url;
@@ -498,7 +498,7 @@ else {
// garvin: if a table or database gets dropped, check column comments.
if (isset($purge) && $purge == '1') {
include('./libraries/relation_cleanup.lib.php');
require_once('./libraries/relation_cleanup.lib.php');
if (isset($table) && isset($db) && !empty($table) && !empty($db)) {
PMA_relationsCleanupTable($db, $table);
@@ -513,7 +513,7 @@ else {
if (isset($cpurge) && $cpurge == '1' && isset($purgekey)
&& isset($db) && isset($table)
&& !empty($db) && !empty($table) && !empty($purgekey)) {
include('./libraries/relation_cleanup.lib.php');
require_once('./libraries/relation_cleanup.lib.php');
PMA_relationsCleanupColumn($db, $table, $purgekey);
} // end if column PMA_* purge
@@ -585,10 +585,10 @@ else {
$js_to_run = 'functions.js';
}
if ($goto != 'main.php') {
include('./header.inc.php');
require_once('./header.inc.php');
}
$active_page = $goto;
include('./' . $goto);
require('./' . $goto);
} // end if file_exist
else {
header('Location: ' . $cfg['PmaAbsoluteUri'] . str_replace('&amp;', '&', $goto) . '&message=' . urlencode($message));
@@ -603,22 +603,22 @@ else {
unset($show_query);
}
if (isset($printview) && $printview == '1') {
include('./header_printview.inc.php');
require_once('./header_printview.inc.php');
} else {
$js_to_run = 'functions.js';
unset($message);
if (!empty($table)) {
include('./tbl_properties_common.php');
require('./tbl_properties_common.php');
$url_query .= '&amp;goto=tbl_properties.php&amp;back=tbl_properties.php';
include('./tbl_properties_table_info.php');
require('./tbl_properties_table_info.php');
}
else {
include('./db_details_common.php');
include('./db_details_db_info.php');
require('./db_details_common.php');
require('./db_details_db_info.php');
}
}
include('./libraries/relation.lib.php');
require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam();
// Gets the list of fields properties
@@ -641,7 +641,7 @@ else {
}
// Displays the results in a table
include('./libraries/display_tbl.lib.php');
require_once('./libraries/display_tbl.lib.php');
if (empty($disp_mode)) {
// see the "PMA_setDisplayMode()" function in
// libraries/display_tbl.lib.php
@@ -786,5 +786,5 @@ echo "\n\n";
/**
* Displays the footer
*/
require('./footer.inc.php');
require_once('./footer.inc.php');
?>

View File

@@ -6,9 +6,9 @@
/**
* Get 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');
// Check parameters
PMA_checkParameters(array('db', 'table'));
@@ -183,8 +183,8 @@ if (isset($submit)) {
} // end if
// garvin: If comments were sent, enable relation stuff
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();
@@ -207,8 +207,7 @@ if (isset($submit)) {
unset($sql_query_cpy);
$message = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenAltered;
$active_page = 'tbl_properties_structure.php';
include('./tbl_properties_structure.php');
exit();
require('./tbl_properties_structure.php');
} else {
PMA_mysqlDie('', '', '', $err_url, FALSE);
// garvin: An error happened while inserting/updating a table definition.
@@ -227,11 +226,11 @@ if (isset($submit)) {
*/
if ($abort == FALSE) {
$action = 'tbl_addfield.php';
include('./tbl_properties.inc.php');
require('./tbl_properties.inc.php');
// Diplays the footer
echo "\n";
include('./footer.inc.php');
require_once('./footer.inc.php');
}
?>

View File

@@ -6,9 +6,9 @@
/**
* Gets some core libraries
*/
require('./libraries/grab_globals.lib.php');
require_once('./libraries/grab_globals.lib.php');
$js_to_run = 'functions.js';
include('./header.inc.php');
require_once('./header.inc.php');
// Check parameters
PMA_checkParameters(array('db', 'table'));
@@ -84,8 +84,8 @@ if (isset($submit)) {
$btnDrop = 'Fake';
// garvin: If comments were sent, enable relation stuff
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();
@@ -142,8 +142,7 @@ if (isset($submit)) {
}
$active_page = 'tbl_properties_structure.php';
include('./tbl_properties_structure.php');
exit();
require('./tbl_properties_structure.php');
} else {
PMA_mysqlDie('', '', '', $err_url, FALSE);
// garvin: An error happened while inserting/updating a table definition.
@@ -184,12 +183,12 @@ if ($abort == FALSE) {
$num_fields = count($fields_meta);
$action = 'tbl_alter.php';
include('./tbl_properties.inc.php');
require('./tbl_properties.inc.php');
}
/**
* Displays the footer
*/
require('./footer.inc.php');
require_once('./footer.inc.php');
?>

View File

@@ -6,10 +6,10 @@
/**
* 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');
$js_to_run = 'tbl_change.js';
require('./header.inc.php');
require('./libraries/relation.lib.php'); // foreign keys
require_once('./header.inc.php');
require_once('./libraries/relation.lib.php'); // foreign keys
/**
@@ -453,7 +453,7 @@ for ($i = 0; $i < $fields_cnt; $i++) {
// The value column (depends on type)
// ----------------
include('./libraries/get_foreign.lib.php');
require('./libraries/get_foreign.lib.php');
if (isset($foreign_link) && $foreign_link == true) {
?>
@@ -780,5 +780,5 @@ if (!empty($disp_message)) {
* Displays the footer
*/
echo "\n";
require('./footer.inc.php');
require_once('./footer.inc.php');
?>

View File

@@ -6,15 +6,13 @@
/**
* Get 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');
// Check parameters
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
include('./libraries/common.lib.php');
}
require_once('./libraries/common.lib.php');
PMA_checkParameters(array('db', 'table'));
@@ -185,8 +183,8 @@ if (isset($submit)) {
$message = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenCreated;
// garvin: If comments were sent, enable relation stuff
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();
@@ -204,7 +202,7 @@ if (isset($submit)) {
}
}
include('./' . $cfg['DefaultTabTable']);
require('./' . $cfg['DefaultTabTable']);
$abort = TRUE;
exit();
} else {
@@ -235,10 +233,10 @@ if ($abort == FALSE) {
// Table name and number of fields are valid -> show the form
else {
$action = 'tbl_create.php';
include('./tbl_properties.inc.php');
require('./tbl_properties.inc.php');
// Diplays the footer
echo "\n";
include('./footer.inc.php');
require_once('./footer.inc.php');
}
}

View File

@@ -6,12 +6,8 @@
/**
* 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');
}
require_once('./libraries/grab_globals.lib.php');
require_once('./libraries/common.lib.php');
/**
@@ -37,7 +33,7 @@ if (!defined('PMA_IDX_INCLUDED')) {
}
if (empty($db) || !$is_db) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php?' . PMA_generate_common_url('', '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
exit();
exit;
}
// Not a valid table name -> back to the default db_details sub-page
if (!empty($table)) {
@@ -46,14 +42,14 @@ if (!defined('PMA_IDX_INCLUDED')) {
if (empty($table)
|| !($is_table && @mysql_numrows($is_table))) {
header('Location: ' . $cfg['PmaAbsoluteUri'] . $cfg['DefaultTabDatabase'] . '?' . PMA_generate_common_url($db, '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
exit();
exit;
} else if (isset($is_table)) {
mysql_free_result($is_table);
}
// Displays headers (if needed)
$js_to_run = ((isset($index) && isset($do_save_data)) ? 'functions.js' : 'indexes.js');
include('./header.inc.php');
require_once('./header.inc.php');
} // end if
@@ -209,8 +205,7 @@ if (!defined('PMA_IDX_INCLUDED')
$message = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenAltered;
$active_page = 'tbl_properties_structure.php';
include('./tbl_properties_structure.php');
exit();
require('./tbl_properties_structure.php');
} // end builds the new index
@@ -504,6 +499,6 @@ else if (!defined('PMA_IDX_INCLUDED')
echo "\n";
if (!defined('PMA_IDX_INCLUDED')){
include('./footer.inc.php');
require_once('./footer.inc.php');
}
?>

View File

@@ -4,11 +4,8 @@
// Check parameters
require('./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');
PMA_checkParameters(array('db', 'table'));
@@ -107,8 +104,8 @@ global $cfgRelation;
/**
* Gets some core libraries
*/
require('./libraries/grab_globals.lib.php');
require('./libraries/common.lib.php');
require_once('./libraries/grab_globals.lib.php');
require_once('./libraries/common.lib.php');
/**
@@ -150,7 +147,7 @@ if (isset($new_name) && trim($new_name) != '') {
// do not create the table if dataonly
if ($what != 'dataonly') {
include('./libraries/export/sql.php');
require('./libraries/export/sql.php');
$no_constraints_comments = true;
$sql_structure = PMA_getTableDef($db, $table, "\n", $err_url);
@@ -174,7 +171,7 @@ if (isset($new_name) && trim($new_name) != '') {
$drop_query = 'DROP TABLE IF EXISTS ' . PMA_backquote($target_db) . '.' . PMA_backquote($new_name);
$result = @PMA_mysql_query($drop_query);
if (PMA_mysql_error()) {
include('./header.inc.php');
require_once('./header.inc.php');
PMA_mysqlDie('', $sql_structure, '', $err_url);
}
@@ -191,7 +188,7 @@ if (isset($new_name) && trim($new_name) != '') {
$result = @PMA_mysql_query($sql_structure);
if (PMA_mysql_error()) {
include('./header.inc.php');
require_once('./header.inc.php');
PMA_mysqlDie('', $sql_structure, '', $err_url);
} else if (isset($sql_query)) {
$sql_query .= "\n" . $sql_structure . ';';
@@ -212,7 +209,7 @@ if (isset($new_name) && trim($new_name) != '') {
$sql_constraints = PMA_SQP_formatHtml($parsed_sql, 'query_only');
$result = @PMA_mysql_query($sql_constraints);
if (PMA_mysql_error()) {
include('./header.inc.php');
require_once('./header.inc.php');
PMA_mysqlDie('', $sql_structure, '', $err_url);
} else if (isset($sql_query)) {
$sql_query .= "\n" . $sql_constraints;
@@ -230,13 +227,13 @@ if (isset($new_name) && trim($new_name) != '') {
$sql_insert_data = 'INSERT INTO ' . $target . ' SELECT * FROM ' . $source;
$result = @PMA_mysql_query($sql_insert_data);
if (PMA_mysql_error()) {
include('./header.inc.php');
require_once('./header.inc.php');
PMA_mysqlDie('', $sql_insert_data, '', $err_url);
}
$sql_query .= "\n\n" . $sql_insert_data . ';';
}
include('./libraries/relation.lib.php');
require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam();
// Drops old table if the user has requested to move it
@@ -249,7 +246,7 @@ if (isset($new_name) && trim($new_name) != '') {
$sql_drop_table = 'DROP TABLE ' . $source;
$result = @PMA_mysql_query($sql_drop_table);
if (PMA_mysql_error()) {
include('./header.inc.php');
require_once('./header.inc.php');
PMA_mysqlDie('', $sql_drop_table, '', $err_url);
}
@@ -431,7 +428,7 @@ if (isset($new_name) && trim($new_name) != '') {
}
}
}
include('./header.inc.php');
require_once('./header.inc.php');
} // end is target table name
@@ -439,7 +436,7 @@ if (isset($new_name) && trim($new_name) != '') {
* No new name for the table!
*/
else {
include('./header.inc.php');
require_once('./header.inc.php');
PMA_mysqlDie($strTableEmpty, '', '', $err_url);
}

View File

@@ -6,8 +6,8 @@
* 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');
}
// Check parameters
@@ -19,8 +19,8 @@ if (!isset($the_tables) || !is_array($the_tables)) {
/**
* 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();
@@ -632,5 +632,5 @@ function printPage()
<?php
echo '<br /><br />&nbsp;<input type="button" style="visibility: ; width: 100px; height: 25px" id="print" value="' . $strPrint . '" onclick="printPage()">' . "\n";
require('./footer.inc.php');
require_once('./footer.inc.php');
?>

View File

@@ -3,18 +3,12 @@
// vim: expandtab sw=4 ts=4 sts=4:
// Check parameters
if (!defined('PMA_COMMON_LIB_INCLUDED')) {
include('./libraries/common.lib.php');
}
require_once('./libraries/common.lib.php');
PMA_checkParameters(array('db','table','action','num_fields'));
// Get available character sets (MySQL >= 4.1)
if (PMA_MYSQL_INT_VERSION >= 40100 && !defined('PMA_MYSQL_CHARSETS_LIB_INCLUDED')) {
include('./libraries/mysql_charsets.lib.php');
}
// Get available character sets
require_once('./libraries/mysql_charsets.lib.php');
?>
<?php if ($cfg['CtrlArrowsMoving']) { ?>
@@ -98,8 +92,8 @@ $header_cells[] = $strNull;
$header_cells[] = $strDefault . '**';
$header_cells[] = $strExtra;
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();
$comments_map = array();

View File

@@ -35,5 +35,5 @@ require('./tbl_query_box.php');
* Displays the footer
*/
echo "\n";
require('./footer.inc.php');
require_once('./footer.inc.php');
?>

View File

@@ -6,15 +6,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');
// Check parameters
PMA_checkParameters(array('db','table'));
@@ -29,7 +23,7 @@ $err_url = $cfg['DefaultTabTable'] . '?' . PMA_generate_common_url($db, $table
/**
* Ensures the database and the table exist (else move to the "parent" script)
*/
require('./libraries/db_table_exists.lib.php');
require_once('./libraries/db_table_exists.lib.php');
/**
@@ -37,7 +31,7 @@ require('./libraries/db_table_exists.lib.php');
*/
if (!isset($message)) {
$js_to_run = 'functions.js';
include('./header.inc.php');
require_once('./header.inc.php');
} else {
PMA_showMessage($message);
unset($message);

Some files were not shown because too many files have changed in this diff Show More