(not complete) PEAR coding standard
This commit is contained in:
@@ -17,6 +17,7 @@ $Source$
|
|||||||
- clarified some variable names
|
- clarified some variable names
|
||||||
* db_sarch.php:
|
* db_sarch.php:
|
||||||
fixed bug: Undefined variable: num_tables
|
fixed bug: Undefined variable: num_tables
|
||||||
|
* [really much files]: (not complete) PEAR coding standard
|
||||||
|
|
||||||
2006-01-16 Marc Delisle <lem9@users.sourceforge.net>
|
2006-01-16 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* server_privileges.php: typo
|
* server_privileges.php: typo
|
||||||
|
@@ -52,7 +52,7 @@ if ($cfgRelation['commwork']) {
|
|||||||
* Selects the database and gets tables names
|
* Selects the database and gets tables names
|
||||||
*/
|
*/
|
||||||
PMA_DBI_select_db($db);
|
PMA_DBI_select_db($db);
|
||||||
$rowset = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', NULL, PMA_DBI_QUERY_STORE);
|
$rowset = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', null, PMA_DBI_QUERY_STORE);
|
||||||
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
while ($row = PMA_DBI_fetch_assoc($rowset)) {
|
while ($row = PMA_DBI_fetch_assoc($rowset)) {
|
||||||
@@ -128,7 +128,7 @@ while ($row = PMA_DBI_fetch_assoc($rowset)) {
|
|||||||
/**
|
/**
|
||||||
* Gets fields properties
|
* Gets fields properties
|
||||||
*/
|
*/
|
||||||
$result = PMA_DBI_query('SHOW FIELDS FROM ' . PMA_backquote($table) . ';', NULL, PMA_DBI_QUERY_STORE);
|
$result = PMA_DBI_query('SHOW FIELDS FROM ' . PMA_backquote($table) . ';', null, PMA_DBI_QUERY_STORE);
|
||||||
$fields_cnt = PMA_DBI_num_rows($result);
|
$fields_cnt = PMA_DBI_num_rows($result);
|
||||||
// Check if we can use Relations (Mike Beck)
|
// Check if we can use Relations (Mike Beck)
|
||||||
if (!empty($cfgRelation['relation'])) {
|
if (!empty($cfgRelation['relation'])) {
|
||||||
@@ -141,8 +141,7 @@ while ($row = PMA_DBI_fetch_assoc($rowset)) {
|
|||||||
} else {
|
} else {
|
||||||
$have_rel = FALSE;
|
$have_rel = FALSE;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$have_rel = FALSE;
|
$have_rel = FALSE;
|
||||||
} // end if
|
} // end if
|
||||||
|
|
||||||
@@ -237,7 +236,7 @@ while ($row = PMA_DBI_fetch_assoc($rowset)) {
|
|||||||
<td<?php echo $type_nowrap; ?> xml:lang="en" dir="ltr"><?php echo $type; ?></td>
|
<td<?php echo $type_nowrap; ?> xml:lang="en" dir="ltr"><?php echo $type; ?></td>
|
||||||
<?php /* <td<?php echo $type_nowrap; ?>><?php echo $strAttribute; ?></td>*/ ?>
|
<?php /* <td<?php echo $type_nowrap; ?>><?php echo $strAttribute; ?></td>*/ ?>
|
||||||
<td><?php echo (($row['Null'] == '' || $row['Null'] == 'NO') ? $strNo : $strYes); ?></td>
|
<td><?php echo (($row['Null'] == '' || $row['Null'] == 'NO') ? $strNo : $strYes); ?></td>
|
||||||
<td nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?></td>
|
<td nowrap="nowrap"><?php if (isset($row['Default'])) { echo $row['Default']; } ?></td>
|
||||||
<?php /* <td<?php echo $type_nowrap; ?>><?php echo $row['Extra']; ?></td>*/ ?>
|
<?php /* <td<?php echo $type_nowrap; ?>><?php echo $row['Extra']; ?></td>*/ ?>
|
||||||
<?php
|
<?php
|
||||||
if ($have_rel) {
|
if ($have_rel) {
|
||||||
|
@@ -125,14 +125,11 @@ if (isset($cfg['docSQLDir']) && !empty($cfg['docSQLDir'])) {
|
|||||||
if (empty($DOCUMENT_ROOT)) {
|
if (empty($DOCUMENT_ROOT)) {
|
||||||
if (!empty($_SERVER) && isset($_SERVER['DOCUMENT_ROOT'])) {
|
if (!empty($_SERVER) && isset($_SERVER['DOCUMENT_ROOT'])) {
|
||||||
$DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
|
$DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
|
||||||
}
|
} elseif (!empty($_ENV) && isset($_ENV['DOCUMENT_ROOT'])) {
|
||||||
else if (!empty($_ENV) && isset($_ENV['DOCUMENT_ROOT'])) {
|
|
||||||
$DOCUMENT_ROOT = $_ENV['DOCUMENT_ROOT'];
|
$DOCUMENT_ROOT = $_ENV['DOCUMENT_ROOT'];
|
||||||
}
|
} elseif (@getenv('DOCUMENT_ROOT')) {
|
||||||
else if (@getenv('DOCUMENT_ROOT')) {
|
|
||||||
$DOCUMENT_ROOT = getenv('DOCUMENT_ROOT');
|
$DOCUMENT_ROOT = getenv('DOCUMENT_ROOT');
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$DOCUMENT_ROOT = '.';
|
$DOCUMENT_ROOT = '.';
|
||||||
}
|
}
|
||||||
} // end if
|
} // end if
|
||||||
@@ -173,15 +170,13 @@ if (isset($cfg['docSQLDir']) && !empty($cfg['docSQLDir'])) {
|
|||||||
echo $strFileCouldNotBeRead;
|
echo $strFileCouldNotBeRead;
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$sql_file_new = $tmp_subdir . basename($sql_file);
|
$sql_file_new = $tmp_subdir . basename($sql_file);
|
||||||
move_uploaded_file($sql_file, $sql_file_new);
|
move_uploaded_file($sql_file, $sql_file_new);
|
||||||
$docsql_text = PMA_readFile($sql_file_new, $sql_file_compression);
|
$docsql_text = PMA_readFile($sql_file_new, $sql_file_compression);
|
||||||
unlink($sql_file_new);
|
unlink($sql_file_new);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// read from the normal upload dir
|
// read from the normal upload dir
|
||||||
$docsql_text = PMA_readFile($sql_file, $sql_file_compression);
|
$docsql_text = PMA_readFile($sql_file, $sql_file_compression);
|
||||||
}
|
}
|
||||||
@@ -228,7 +223,7 @@ if (isset($cfg['docSQLDir']) && !empty($cfg['docSQLDir'])) {
|
|||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<form method="post" action="db_details_importdocsql.php" <?php if ($is_upload) echo ' enctype="multipart/form-data"'; ?>>
|
<form method="post" action="db_details_importdocsql.php" <?php if ($is_upload) { echo ' enctype="multipart/form-data"'; } ?>>
|
||||||
<?php echo PMA_generate_common_hidden_inputs($db); ?>
|
<?php echo PMA_generate_common_hidden_inputs($db); ?>
|
||||||
<input type="hidden" name="submit_show" value="true" />
|
<input type="hidden" name="submit_show" value="true" />
|
||||||
<input type="hidden" name="do" value="import" />
|
<input type="hidden" name="do" value="import" />
|
||||||
|
@@ -152,7 +152,7 @@ $row_count = 0;
|
|||||||
$hidden_fields = array();
|
$hidden_fields = array();
|
||||||
$odd_row = true;
|
$odd_row = true;
|
||||||
foreach ( $tables as $keyname => $each_table ) {
|
foreach ( $tables as $keyname => $each_table ) {
|
||||||
if ( $each_table['TABLE_ROWS'] === NULL || $each_table['TABLE_ROWS'] < $GLOBALS['cfg']['MaxExactCount']) {
|
if ( $each_table['TABLE_ROWS'] === null || $each_table['TABLE_ROWS'] < $GLOBALS['cfg']['MaxExactCount']) {
|
||||||
$each_table['TABLE_ROWS'] = PMA_countRecords( $db,
|
$each_table['TABLE_ROWS'] = PMA_countRecords( $db,
|
||||||
$each_table['TABLE_NAME'], $return = true, $force_exact = true );
|
$each_table['TABLE_NAME'], $return = true, $force_exact = true );
|
||||||
}
|
}
|
||||||
|
@@ -332,7 +332,7 @@ if ($cfgRelation['pdfwork'] && $num_tables > 0) { ?>
|
|||||||
SELECT *
|
SELECT *
|
||||||
FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['pdf_pages']) . '
|
FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['pdf_pages']) . '
|
||||||
WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';
|
WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';
|
||||||
$test_rs = PMA_query_as_cu($test_query, NULL, PMA_DBI_QUERY_STORE);
|
$test_rs = PMA_query_as_cu($test_query, null, PMA_DBI_QUERY_STORE);
|
||||||
|
|
||||||
if ($test_rs && PMA_DBI_num_rows($test_rs) > 0) { ?>
|
if ($test_rs && PMA_DBI_num_rows($test_rs) > 0) { ?>
|
||||||
<!-- PDF schema -->
|
<!-- PDF schema -->
|
||||||
|
@@ -44,7 +44,7 @@ if ($cfg['SkipLockedTables'] == TRUE) {
|
|||||||
unset($result);
|
unset($result);
|
||||||
|
|
||||||
if (isset($sot_cache)) {
|
if (isset($sot_cache)) {
|
||||||
$result = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', NULL, PMA_DBI_QUERY_STORE);
|
$result = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', null, PMA_DBI_QUERY_STORE);
|
||||||
if ($result != FALSE && PMA_DBI_num_rows($result) > 0) {
|
if ($result != FALSE && PMA_DBI_num_rows($result) > 0) {
|
||||||
while ($tmp = PMA_DBI_fetch_row($result)) {
|
while ($tmp = PMA_DBI_fetch_row($result)) {
|
||||||
if (!isset($sot_cache[$tmp[0]])) {
|
if (!isset($sot_cache[$tmp[0]])) {
|
||||||
@@ -159,8 +159,7 @@ else {
|
|||||||
elseif ($cfg['ShowStats'] && $mergetable == TRUE) {
|
elseif ($cfg['ShowStats'] && $mergetable == TRUE) {
|
||||||
$formated_size = ' - ';
|
$formated_size = ' - ';
|
||||||
$unit = '';
|
$unit = '';
|
||||||
}
|
} elseif ($cfg['ShowStats']) {
|
||||||
else if ($cfg['ShowStats']) {
|
|
||||||
$formated_size = 'unknown';
|
$formated_size = 'unknown';
|
||||||
$unit = '';
|
$unit = '';
|
||||||
}
|
}
|
||||||
|
@@ -59,10 +59,11 @@ header('Content-Type: text/html; charset=' . $charset);
|
|||||||
<body>
|
<body>
|
||||||
<h1>phpMyAdmin - <?php echo $type; ?></h1>
|
<h1>phpMyAdmin - <?php echo $type; ?></h1>
|
||||||
<p><?php
|
<p><?php
|
||||||
if (get_magic_quotes_gpc())
|
if (get_magic_quotes_gpc()) {
|
||||||
echo PMA_sanitize(stripslashes($_REQUEST['error']));
|
echo PMA_sanitize(stripslashes($_REQUEST['error']));
|
||||||
else
|
} else {
|
||||||
echo PMA_sanitize($_REQUEST['error']);
|
echo PMA_sanitize($_REQUEST['error']);
|
||||||
|
}
|
||||||
?></p>
|
?></p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
68
export.php
68
export.php
@@ -172,17 +172,26 @@ $onfly_compression = $GLOBALS['cfg']['CompressOnFly'] && isset($compression) &&
|
|||||||
if ($onfly_compression) {
|
if ($onfly_compression) {
|
||||||
$memory_limit = trim(@ini_get('memory_limit'));
|
$memory_limit = trim(@ini_get('memory_limit'));
|
||||||
// 2 MB as default
|
// 2 MB as default
|
||||||
if (empty($memory_limit)) $memory_limit = 2 * 1024 * 1024;
|
if (empty($memory_limit)) {
|
||||||
|
$memory_limit = 2 * 1024 * 1024;
|
||||||
|
}
|
||||||
|
|
||||||
if (strtolower(substr($memory_limit, -1)) == 'm') $memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024;
|
if (strtolower(substr($memory_limit, -1)) == 'm') {
|
||||||
elseif (strtolower(substr($memory_limit, -1)) == 'k') $memory_limit = (int)substr($memory_limit, 0, -1) * 1024;
|
$memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024;
|
||||||
elseif (strtolower(substr($memory_limit, -1)) == 'g') $memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024 * 1024;
|
} elseif (strtolower(substr($memory_limit, -1)) == 'k') {
|
||||||
else $memory_limit = (int)$memory_limit;
|
$memory_limit = (int)substr($memory_limit, 0, -1) * 1024;
|
||||||
|
} elseif (strtolower(substr($memory_limit, -1)) == 'g') {
|
||||||
|
$memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024 * 1024;
|
||||||
|
} else {
|
||||||
|
$memory_limit = (int)$memory_limit;
|
||||||
|
}
|
||||||
|
|
||||||
// Some of memory is needed for other thins and as treshold.
|
// Some of memory is needed for other thins and as treshold.
|
||||||
// Nijel: During export I had allocated (see memory_get_usage function)
|
// Nijel: During export I had allocated (see memory_get_usage function)
|
||||||
// approx 1.2MB so this comes from that.
|
// approx 1.2MB so this comes from that.
|
||||||
if ($memory_limit > 1500000) $memory_limit -= 1500000;
|
if ($memory_limit > 1500000) {
|
||||||
|
$memory_limit -= 1500000;
|
||||||
|
}
|
||||||
|
|
||||||
// Some memory is needed for compression, assume 1/3
|
// Some memory is needed for compression, assume 1/3
|
||||||
$memory_limit *= 2/3;
|
$memory_limit *= 2/3;
|
||||||
@@ -374,7 +383,9 @@ if ($export_type == 'database') {
|
|||||||
do {
|
do {
|
||||||
|
|
||||||
// Add possibly some comments to export
|
// Add possibly some comments to export
|
||||||
if (!PMA_exportHeader()) break;
|
if (!PMA_exportHeader()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Will we need relation & co. setup?
|
// Will we need relation & co. setup?
|
||||||
$do_relation = isset($GLOBALS[$what . '_relation']);
|
$do_relation = isset($GLOBALS[$what . '_relation']);
|
||||||
@@ -411,29 +422,35 @@ if ($export_type == 'server') {
|
|||||||
foreach ($dblist AS $current_db) {
|
foreach ($dblist AS $current_db) {
|
||||||
if ((isset($tmp_select) && strpos(' ' . $tmp_select, '|' . $current_db . '|'))
|
if ((isset($tmp_select) && strpos(' ' . $tmp_select, '|' . $current_db . '|'))
|
||||||
|| !isset($tmp_select)) {
|
|| !isset($tmp_select)) {
|
||||||
if (!PMA_exportDBHeader($current_db))
|
if (!PMA_exportDBHeader($current_db)) {
|
||||||
break 2;
|
break 2;
|
||||||
if (!PMA_exportDBCreate($current_db))
|
}
|
||||||
|
if (!PMA_exportDBCreate($current_db)) {
|
||||||
break 2;
|
break 2;
|
||||||
|
}
|
||||||
$tables = PMA_DBI_get_tables($current_db);
|
$tables = PMA_DBI_get_tables($current_db);
|
||||||
foreach ($tables as $table) {
|
foreach ($tables as $table) {
|
||||||
$local_query = 'SELECT * FROM ' . PMA_backquote($current_db) . '.' . PMA_backquote($table);
|
$local_query = 'SELECT * FROM ' . PMA_backquote($current_db) . '.' . PMA_backquote($table);
|
||||||
if (isset($GLOBALS[$what . '_structure'])) {
|
if (isset($GLOBALS[$what . '_structure'])) {
|
||||||
if (!PMA_exportStructure($current_db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates))
|
if (!PMA_exportStructure($current_db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates)) {
|
||||||
break 3;
|
break 3;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (isset($GLOBALS[$what . '_data'])) {
|
if (isset($GLOBALS[$what . '_data'])) {
|
||||||
if (!PMA_exportData($current_db, $table, $crlf, $err_url, $local_query))
|
if (!PMA_exportData($current_db, $table, $crlf, $err_url, $local_query)) {
|
||||||
break 3;
|
break 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!PMA_exportDBFooter($current_db))
|
}
|
||||||
|
if (!PMA_exportDBFooter($current_db)) {
|
||||||
break 2;
|
break 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} elseif ($export_type == 'database') {
|
} elseif ($export_type == 'database') {
|
||||||
if (!PMA_exportDBHeader($db))
|
if (!PMA_exportDBHeader($db)) {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($table_select)) {
|
if (isset($table_select)) {
|
||||||
$tmp_select = implode($table_select, '|');
|
$tmp_select = implode($table_select, '|');
|
||||||
@@ -446,20 +463,24 @@ if ($export_type == 'server') {
|
|||||||
|| !isset($tmp_select)) {
|
|| !isset($tmp_select)) {
|
||||||
|
|
||||||
if (isset($GLOBALS[$what . '_structure'])) {
|
if (isset($GLOBALS[$what . '_structure'])) {
|
||||||
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates))
|
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates)) {
|
||||||
break 2;
|
break 2;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (isset($GLOBALS[$what . '_data'])) {
|
if (isset($GLOBALS[$what . '_data'])) {
|
||||||
if (!PMA_exportData($db, $table, $crlf, $err_url, $local_query))
|
if (!PMA_exportData($db, $table, $crlf, $err_url, $local_query)) {
|
||||||
break 2;
|
break 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!PMA_exportDBFooter($db))
|
}
|
||||||
|
if (!PMA_exportDBFooter($db)) {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!PMA_exportDBHeader($db))
|
if (!PMA_exportDBHeader($db)) {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
// We export just one table
|
// We export just one table
|
||||||
|
|
||||||
if ($limit_to > 0 && $limit_from >= 0) {
|
if ($limit_to > 0 && $limit_from >= 0) {
|
||||||
@@ -478,17 +499,22 @@ if ($export_type == 'server') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($GLOBALS[$what . '_structure'])) {
|
if (isset($GLOBALS[$what . '_structure'])) {
|
||||||
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates))
|
if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (isset($GLOBALS[$what . '_data'])) {
|
if (isset($GLOBALS[$what . '_data'])) {
|
||||||
if (!PMA_exportData($db, $table, $crlf, $err_url, $local_query))
|
if (!PMA_exportData($db, $table, $crlf, $err_url, $local_query)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!PMA_exportDBFooter($db))
|
}
|
||||||
|
if (!PMA_exportDBFooter($db)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!PMA_exportFooter()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!PMA_exportFooter()) break;
|
|
||||||
|
|
||||||
} while (FALSE);
|
} while (FALSE);
|
||||||
// End of fake loop
|
// End of fake loop
|
||||||
|
13
import.php
13
import.php
@@ -180,10 +180,15 @@ if ($memory_limit = -1) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Calculate value of the limit
|
// Calculate value of the limit
|
||||||
if (strtolower(substr($memory_limit, -1)) == 'm') $memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024;
|
if (strtolower(substr($memory_limit, -1)) == 'm') {
|
||||||
elseif (strtolower(substr($memory_limit, -1)) == 'k') $memory_limit = (int)substr($memory_limit, 0, -1) * 1024;
|
$memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024;
|
||||||
elseif (strtolower(substr($memory_limit, -1)) == 'g') $memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024 * 1024;
|
} elseif (strtolower(substr($memory_limit, -1)) == 'k') {
|
||||||
else $memory_limit = (int)$memory_limit;
|
$memory_limit = (int)substr($memory_limit, 0, -1) * 1024;
|
||||||
|
} elseif (strtolower(substr($memory_limit, -1)) == 'g') {
|
||||||
|
$memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024 * 1024;
|
||||||
|
} else {
|
||||||
|
$memory_limit = (int)$memory_limit;
|
||||||
|
}
|
||||||
|
|
||||||
$read_limit = $memory_limit / 4; // Just to be sure, there might be lot of memory needed for uncompression
|
$read_limit = $memory_limit / 4; // Just to be sure, there might be lot of memory needed for uncompression
|
||||||
|
|
||||||
|
@@ -48,11 +48,9 @@ session_write_close();
|
|||||||
if (empty($HTTP_HOST)) {
|
if (empty($HTTP_HOST)) {
|
||||||
if (!empty($_ENV) && isset($_ENV['HTTP_HOST'])) {
|
if (!empty($_ENV) && isset($_ENV['HTTP_HOST'])) {
|
||||||
$HTTP_HOST = $_ENV['HTTP_HOST'];
|
$HTTP_HOST = $_ENV['HTTP_HOST'];
|
||||||
}
|
} elseif (@getenv('HTTP_HOST')) {
|
||||||
elseif (@getenv('HTTP_HOST')) {
|
|
||||||
$HTTP_HOST = getenv('HTTP_HOST');
|
$HTTP_HOST = getenv('HTTP_HOST');
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$HTTP_HOST = '';
|
$HTTP_HOST = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -34,9 +34,10 @@ class PMA_Theme_Manager {
|
|||||||
/**
|
/**
|
||||||
* @var object PMA_Theme active theme
|
* @var object PMA_Theme active theme
|
||||||
*/
|
*/
|
||||||
var $theme = NULL;
|
var $theme = null;
|
||||||
|
|
||||||
function __construct() {
|
function __construct()
|
||||||
|
{
|
||||||
$this->themes_path = trim($GLOBALS['cfg']['ThemePath']) ;
|
$this->themes_path = trim($GLOBALS['cfg']['ThemePath']) ;
|
||||||
$this->per_server = (bool) $GLOBALS['cfg']['ThemePerServer'];
|
$this->per_server = (bool) $GLOBALS['cfg']['ThemePerServer'];
|
||||||
$this->theme = new PMA_Theme;
|
$this->theme = new PMA_Theme;
|
||||||
@@ -70,11 +71,13 @@ class PMA_Theme_Manager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function __wakeup() {
|
function __wakeup()
|
||||||
|
{
|
||||||
$this->loadThemes($this->themes_path);
|
$this->loadThemes($this->themes_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
function setActiveTheme( $theme = NULL ) {
|
function setActiveTheme($theme = null)
|
||||||
|
{
|
||||||
if ( ! $this->checkTheme($theme)) {
|
if ( ! $this->checkTheme($theme)) {
|
||||||
$GLOBALS['PMA_errors'][] = sprintf($GLOBALS['strThemeNotFound'],
|
$GLOBALS['PMA_errors'][] = sprintf($GLOBALS['strThemeNotFound'],
|
||||||
$theme);
|
$theme);
|
||||||
@@ -96,7 +99,8 @@ class PMA_Theme_Manager {
|
|||||||
/**
|
/**
|
||||||
* @return string cookie name
|
* @return string cookie name
|
||||||
*/
|
*/
|
||||||
function getThemeCookieName() {
|
function getThemeCookieName()
|
||||||
|
{
|
||||||
// Allow different theme per server
|
// Allow different theme per server
|
||||||
if (isset($GLOBALS['server']) && $this->per_server) {
|
if (isset($GLOBALS['server']) && $this->per_server) {
|
||||||
return $this->cookie_name . '-' . $GLOBALS['server'];
|
return $this->cookie_name . '-' . $GLOBALS['server'];
|
||||||
@@ -109,7 +113,8 @@ class PMA_Theme_Manager {
|
|||||||
* returns name of theme stored in the cookie
|
* returns name of theme stored in the cookie
|
||||||
* @return string theme name from cookie
|
* @return string theme name from cookie
|
||||||
*/
|
*/
|
||||||
function getThemeCookie() {
|
function getThemeCookie()
|
||||||
|
{
|
||||||
if (isset($_COOKIE[$this->getThemeCookieName()])) {
|
if (isset($_COOKIE[$this->getThemeCookieName()])) {
|
||||||
return $_COOKIE[$this->getThemeCookieName()];
|
return $_COOKIE[$this->getThemeCookieName()];
|
||||||
}
|
}
|
||||||
@@ -126,7 +131,8 @@ class PMA_Theme_Manager {
|
|||||||
* @uses PMA_Theme_Manager::$theme_default
|
* @uses PMA_Theme_Manager::$theme_default
|
||||||
* @uses PMA_Theme::getId()
|
* @uses PMA_Theme::getId()
|
||||||
*/
|
*/
|
||||||
function setThemeCookie() {
|
function setThemeCookie()
|
||||||
|
{
|
||||||
PMA_setCookie($this->getThemeCookieName(), $this->theme->id,
|
PMA_setCookie($this->getThemeCookieName(), $this->theme->id,
|
||||||
$this->theme_default);
|
$this->theme_default);
|
||||||
return true;
|
return true;
|
||||||
@@ -135,7 +141,8 @@ class PMA_Theme_Manager {
|
|||||||
/**
|
/**
|
||||||
* old PHP 4 constructor
|
* old PHP 4 constructor
|
||||||
*/
|
*/
|
||||||
function PMA_Theme_Manager() {
|
function PMA_Theme_Manager()
|
||||||
|
{
|
||||||
$this->__construct();
|
$this->__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,7 +151,8 @@ class PMA_Theme_Manager {
|
|||||||
* @param string $folder
|
* @param string $folder
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
/*private*/ function _checkThemeFolder( $folder ) {
|
/*private*/ function _checkThemeFolder($folder)
|
||||||
|
{
|
||||||
if (! is_dir($folder)) {
|
if (! is_dir($folder)) {
|
||||||
$GLOBALS['PMA_errors'][] =
|
$GLOBALS['PMA_errors'][] =
|
||||||
sprintf($GLOBALS['strThemePathNotFound'],
|
sprintf($GLOBALS['strThemePathNotFound'],
|
||||||
@@ -164,7 +172,8 @@ class PMA_Theme_Manager {
|
|||||||
*
|
*
|
||||||
* @param string $folder themes folders
|
* @param string $folder themes folders
|
||||||
*/
|
*/
|
||||||
function loadThemes( $folder ) {
|
function loadThemes($folder)
|
||||||
|
{
|
||||||
if ($handleThemes = opendir($folder)) {
|
if ($handleThemes = opendir($folder)) {
|
||||||
// check for themes directory
|
// check for themes directory
|
||||||
while (FALSE !== ($PMA_Theme = readdir($handleThemes))) {
|
while (FALSE !== ($PMA_Theme = readdir($handleThemes))) {
|
||||||
@@ -196,7 +205,8 @@ class PMA_Theme_Manager {
|
|||||||
*
|
*
|
||||||
* @param string $theme name fo theme to check for
|
* @param string $theme name fo theme to check for
|
||||||
*/
|
*/
|
||||||
function checkTheme( $theme ) {
|
function checkTheme($theme)
|
||||||
|
{
|
||||||
if (! array_key_exists($theme, $this->themes)) {
|
if (! array_key_exists($theme, $this->themes)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -209,7 +219,8 @@ class PMA_Theme_Manager {
|
|||||||
*
|
*
|
||||||
* @param boolean $form wether enclosed by from tags or not
|
* @param boolean $form wether enclosed by from tags or not
|
||||||
*/
|
*/
|
||||||
function getHtmlSelectBox( $form = true ) {
|
function getHtmlSelectBox($form = true)
|
||||||
|
{
|
||||||
$select_box = '';
|
$select_box = '';
|
||||||
|
|
||||||
if ($form) {
|
if ($form) {
|
||||||
@@ -247,7 +258,8 @@ class PMA_Theme_Manager {
|
|||||||
/**
|
/**
|
||||||
* enables backward compatibility
|
* enables backward compatibility
|
||||||
*/
|
*/
|
||||||
function makeBc() {
|
function makeBc()
|
||||||
|
{
|
||||||
$GLOBALS['theme'] = $this->theme->getId();
|
$GLOBALS['theme'] = $this->theme->getId();
|
||||||
$GLOBALS['pmaThemePath'] = $this->theme->getPath();
|
$GLOBALS['pmaThemePath'] = $this->theme->getPath();
|
||||||
$GLOBALS['pmaThemeImage'] = $this->theme->getImgPath();
|
$GLOBALS['pmaThemeImage'] = $this->theme->getImgPath();
|
||||||
@@ -256,7 +268,7 @@ class PMA_Theme_Manager {
|
|||||||
* load layout file if exists
|
* load layout file if exists
|
||||||
*/
|
*/
|
||||||
if (@file_exists($GLOBALS['pmaThemePath'] . 'layout.inc.php')) {
|
if (@file_exists($GLOBALS['pmaThemePath'] . 'layout.inc.php')) {
|
||||||
include( $GLOBALS['pmaThemePath'] . 'layout.inc.php' );
|
include $GLOBALS['pmaThemePath'] . 'layout.inc.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -268,9 +280,9 @@ class PMA_Theme_Manager {
|
|||||||
* @uses $this->themes
|
* @uses $this->themes
|
||||||
* @uses PMA_Theme::printPreview()
|
* @uses PMA_Theme::printPreview()
|
||||||
*/
|
*/
|
||||||
function printPreviews() {
|
function printPreviews()
|
||||||
|
{
|
||||||
foreach ($this->themes as $each_theme) {
|
foreach ($this->themes as $each_theme) {
|
||||||
|
|
||||||
$each_theme->printPreview();
|
$each_theme->printPreview();
|
||||||
} // end 'open themes'
|
} // end 'open themes'
|
||||||
}
|
}
|
||||||
|
@@ -82,14 +82,12 @@ function PMA_auth()
|
|||||||
// server name
|
// server name
|
||||||
if (!empty($GLOBALS['pma_cookie_servername'])) {
|
if (!empty($GLOBALS['pma_cookie_servername'])) {
|
||||||
$default_server = $GLOBALS['pma_cookie_servername'];
|
$default_server = $GLOBALS['pma_cookie_servername'];
|
||||||
}
|
} elseif (!empty($_COOKIE) && isset($_COOKIE['pma_cookie_servername-' . $server])) {
|
||||||
else if (!empty($_COOKIE) && isset($_COOKIE['pma_cookie_servername-' . $server])) {
|
|
||||||
$default_server = $_COOKIE['pma_cookie_servername-' . $server];
|
$default_server = $_COOKIE['pma_cookie_servername-' . $server];
|
||||||
}
|
}
|
||||||
|
|
||||||
$autocomplete = '';
|
$autocomplete = '';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$default_user = '';
|
$default_user = '';
|
||||||
$autocomplete = ' autocomplete="off"';
|
$autocomplete = ' autocomplete="off"';
|
||||||
}
|
}
|
||||||
@@ -319,8 +317,7 @@ function PMA_auth_check()
|
|||||||
if (!empty($pma_cookie_servername)) {
|
if (!empty($pma_cookie_servername)) {
|
||||||
$pma_auth_server = $pma_cookie_servername;
|
$pma_auth_server = $pma_cookie_servername;
|
||||||
$from_cookie = TRUE;
|
$from_cookie = TRUE;
|
||||||
}
|
} elseif (!empty($_COOKIE) && isset($_COOKIE['pma_cookie_servername-' . $server])) {
|
||||||
else if (!empty($_COOKIE) && isset($_COOKIE['pma_cookie_servername-' . $server])) {
|
|
||||||
$pma_auth_server = $_COOKIE['pma_cookie_servername-' . $server];
|
$pma_auth_server = $_COOKIE['pma_cookie_servername-' . $server];
|
||||||
$from_cookie = TRUE;
|
$from_cookie = TRUE;
|
||||||
}
|
}
|
||||||
@@ -356,11 +353,9 @@ function PMA_auth_check()
|
|||||||
// password
|
// password
|
||||||
if (!empty($pma_cookie_password)) {
|
if (!empty($pma_cookie_password)) {
|
||||||
$PHP_AUTH_PW = $pma_cookie_password;
|
$PHP_AUTH_PW = $pma_cookie_password;
|
||||||
}
|
} elseif (!empty($_COOKIE) && isset($_COOKIE['pma_cookie_password-' . $server])) {
|
||||||
else if (!empty($_COOKIE) && isset($_COOKIE['pma_cookie_password-' . $server])) {
|
|
||||||
$PHP_AUTH_PW = $_COOKIE['pma_cookie_password-' . $server];
|
$PHP_AUTH_PW = $_COOKIE['pma_cookie_password-' . $server];
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$from_cookie = FALSE;
|
$from_cookie = FALSE;
|
||||||
}
|
}
|
||||||
$PHP_AUTH_PW = PMA_blowfish_decrypt($PHP_AUTH_PW, $GLOBALS['cfg']['blowfish_secret'] . $decrypted_time);
|
$PHP_AUTH_PW = PMA_blowfish_decrypt($PHP_AUTH_PW, $GLOBALS['cfg']['blowfish_secret'] . $decrypted_time);
|
||||||
|
@@ -102,7 +102,9 @@ function PMA_queryBookmarks($db, $cfgBookmark, $id, $id_field = 'id', $action_bo
|
|||||||
. ' OR user = \'\')' )
|
. ' OR user = \'\')' )
|
||||||
. ' AND ' . PMA_backquote($id_field) . ' = ' . $id;
|
. ' AND ' . PMA_backquote($id_field) . ' = ' . $id;
|
||||||
$result = PMA_DBI_try_query($query, $controllink);
|
$result = PMA_DBI_try_query($query, $controllink);
|
||||||
if (!$result) return FALSE;
|
if (!$result) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
list($bookmark_query) = PMA_DBI_fetch_row($result) or array(FALSE);
|
list($bookmark_query) = PMA_DBI_fetch_row($result) or array(FALSE);
|
||||||
|
|
||||||
return $bookmark_query;
|
return $bookmark_query;
|
||||||
@@ -140,7 +142,9 @@ function &PMA_queryDBBookmarks($db, $cfgBookmark, &$table_array)
|
|||||||
. ' WHERE dbase = \'' . PMA_sqlAddslashes($db) . '\''
|
. ' WHERE dbase = \'' . PMA_sqlAddslashes($db) . '\''
|
||||||
. (count($search_for) > 0 ? ' AND label IN (' . implode(', ', $search_for) . ')' : '');
|
. (count($search_for) > 0 ? ' AND label IN (' . implode(', ', $search_for) . ')' : '');
|
||||||
$result = PMA_DBI_try_query($query, $controllink, PMA_DBI_QUERY_STORE);
|
$result = PMA_DBI_try_query($query, $controllink, PMA_DBI_QUERY_STORE);
|
||||||
if (!$result || PMA_DBI_num_rows($result) < 1) return $bookmarks;
|
if (!$result || PMA_DBI_num_rows($result) < 1) {
|
||||||
|
return $bookmarks;
|
||||||
|
}
|
||||||
while ($row = PMA_DBI_fetch_assoc($result)) {
|
while ($row = PMA_DBI_fetch_assoc($result)) {
|
||||||
$bookmarks[$row['label']] = $row['query'];
|
$bookmarks[$row['label']] = $row['query'];
|
||||||
}
|
}
|
||||||
|
@@ -143,8 +143,7 @@ function PMA_convert_display_charset($what) {
|
|||||||
// this constant is not defined before the login:
|
// this constant is not defined before the login:
|
||||||
|| (defined('PMA_MYSQL_INT_VERSION') && PMA_MYSQL_INT_VERSION >= 40100) ) { // lem9: even if AllowAnywhereRecoding is TRUE, do not recode for MySQL >= 4.1.x since MySQL does the job
|
|| (defined('PMA_MYSQL_INT_VERSION') && PMA_MYSQL_INT_VERSION >= 40100) ) { // lem9: even if AllowAnywhereRecoding is TRUE, do not recode for MySQL >= 4.1.x since MySQL does the job
|
||||||
return $what;
|
return $what;
|
||||||
}
|
} elseif (is_array($what)) {
|
||||||
else if (is_array($what)) {
|
|
||||||
$result = array();
|
$result = array();
|
||||||
foreach ($what AS $key => $val) {
|
foreach ($what AS $key => $val) {
|
||||||
if (is_string($val) || is_array($val)) {
|
if (is_string($val) || is_array($val)) {
|
||||||
@@ -158,8 +157,7 @@ function PMA_convert_display_charset($what) {
|
|||||||
}
|
}
|
||||||
} // end while
|
} // end while
|
||||||
return $result;
|
return $result;
|
||||||
}
|
} elseif (is_string($what)) {
|
||||||
else if (is_string($what)) {
|
|
||||||
|
|
||||||
switch ($GLOBALS['PMA_recoding_engine']) {
|
switch ($GLOBALS['PMA_recoding_engine']) {
|
||||||
case PMA_CHARSET_RECODE:
|
case PMA_CHARSET_RECODE:
|
||||||
@@ -171,8 +169,7 @@ function PMA_convert_display_charset($what) {
|
|||||||
default:
|
default:
|
||||||
return $what;
|
return $what;
|
||||||
}
|
}
|
||||||
}
|
} elseif (is_object($what)) {
|
||||||
else if (is_object($what)) {
|
|
||||||
// isn't it object returned from mysql_fetch_field ?
|
// isn't it object returned from mysql_fetch_field ?
|
||||||
if (@is_string($what->name)) {
|
if (@is_string($what->name)) {
|
||||||
$what->name = PMA_convert_display_charset($what->name);
|
$what->name = PMA_convert_display_charset($what->name);
|
||||||
@@ -184,8 +181,7 @@ function PMA_convert_display_charset($what) {
|
|||||||
$what->Database = PMA_convert_display_charset($what->Database);
|
$what->Database = PMA_convert_display_charset($what->Database);
|
||||||
}
|
}
|
||||||
return $what;
|
return $what;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// when we don't know what it is we don't touch it...
|
// when we don't know what it is we don't touch it...
|
||||||
return $what;
|
return $what;
|
||||||
}
|
}
|
||||||
@@ -243,7 +239,9 @@ function PMA_convert_charset($what) {
|
|||||||
* @author nijel
|
* @author nijel
|
||||||
*/
|
*/
|
||||||
function PMA_convert_string($src_charset, $dest_charset, $what) {
|
function PMA_convert_string($src_charset, $dest_charset, $what) {
|
||||||
if ($src_charset == $dest_charset) return $what;
|
if ($src_charset == $dest_charset) {
|
||||||
|
return $what;
|
||||||
|
}
|
||||||
switch ($GLOBALS['PMA_recoding_engine']) {
|
switch ($GLOBALS['PMA_recoding_engine']) {
|
||||||
case PMA_CHARSET_RECODE:
|
case PMA_CHARSET_RECODE:
|
||||||
return recode_string($src_charset . '..' . $dest_charset, $what);
|
return recode_string($src_charset . '..' . $dest_charset, $what);
|
||||||
|
@@ -47,8 +47,7 @@ function PMA_analyseShowGrant($rs_usr, &$is_create_db_priv, &$db_to_create, &$is
|
|||||||
$db_to_create = '';
|
$db_to_create = '';
|
||||||
$dbs_where_create_table_allowed[] = '*';
|
$dbs_where_create_table_allowed[] = '*';
|
||||||
break;
|
break;
|
||||||
} // end if
|
} else {
|
||||||
else {
|
|
||||||
// this array may contain wildcards
|
// this array may contain wildcards
|
||||||
$dbs_where_create_table_allowed[] = $show_grants_dbname;
|
$dbs_where_create_table_allowed[] = $show_grants_dbname;
|
||||||
|
|
||||||
@@ -67,7 +66,7 @@ function PMA_analyseShowGrant($rs_usr, &$is_create_db_priv, &$db_to_create, &$is
|
|||||||
if ( (ereg($re0 . '%|_', $show_grants_dbname)
|
if ( (ereg($re0 . '%|_', $show_grants_dbname)
|
||||||
&& !ereg('\\\\%|\\\\_', $show_grants_dbname))
|
&& !ereg('\\\\%|\\\\_', $show_grants_dbname))
|
||||||
// does this db exist?
|
// does this db exist?
|
||||||
|| (!PMA_DBI_try_query('USE ' . ereg_replace($re1 .'(%|_)', '\\1\\3',$dbname_to_test), NULL, PMA_DBI_QUERY_STORE) && substr(PMA_DBI_getError(), 1, 4) != 1044)
|
|| (!PMA_DBI_try_query('USE ' . ereg_replace($re1 .'(%|_)', '\\1\\3', $dbname_to_test), null, PMA_DBI_QUERY_STORE) && substr(PMA_DBI_getError(), 1, 4) != 1044)
|
||||||
) {
|
) {
|
||||||
$db_to_create = ereg_replace($re0 . '%', '\\1...', ereg_replace($re0 . '_', '\\1?', $show_grants_dbname));
|
$db_to_create = ereg_replace($re0 . '%', '\\1...', ereg_replace($re0 . '_', '\\1?', $show_grants_dbname));
|
||||||
$db_to_create = ereg_replace($re1 . '(%|_)', '\\1\\3', $db_to_create);
|
$db_to_create = ereg_replace($re1 . '(%|_)', '\\1\\3', $db_to_create);
|
||||||
@@ -104,7 +103,7 @@ if (PMA_MYSQL_INT_VERSION >= 40102) {
|
|||||||
// $userlink so maybe the SELECT will fail
|
// $userlink so maybe the SELECT will fail
|
||||||
|
|
||||||
if (!$is_create_db_priv) {
|
if (!$is_create_db_priv) {
|
||||||
$res = PMA_DBI_query('SELECT USER();', NULL, PMA_DBI_QUERY_STORE);
|
$res = PMA_DBI_query('SELECT USER();', null, PMA_DBI_QUERY_STORE);
|
||||||
list($mysql_cur_user_and_host) = PMA_DBI_fetch_row($res);
|
list($mysql_cur_user_and_host) = PMA_DBI_fetch_row($res);
|
||||||
$mysql_cur_user = substr($mysql_cur_user_and_host, 0, strrpos($mysql_cur_user_and_host, '@'));
|
$mysql_cur_user = substr($mysql_cur_user_and_host, 0, strrpos($mysql_cur_user_and_host, '@'));
|
||||||
|
|
||||||
@@ -149,8 +148,7 @@ if (PMA_MYSQL_INT_VERSION >= 40102) {
|
|||||||
} // end while
|
} // end while
|
||||||
PMA_DBI_free_result($rs_usr);
|
PMA_DBI_free_result($rs_usr);
|
||||||
unset($rs_usr, $row, $re0, $re1);
|
unset($rs_usr, $row, $re0, $re1);
|
||||||
} // end if
|
} else {
|
||||||
else {
|
|
||||||
// Finally, let's try to get the user's privileges by using SHOW
|
// Finally, let's try to get the user's privileges by using SHOW
|
||||||
// GRANTS...
|
// GRANTS...
|
||||||
// Maybe we'll find a little CREATE priv there :)
|
// Maybe we'll find a little CREATE priv there :)
|
||||||
|
@@ -280,8 +280,7 @@ function PMA_safe_db_list($only_db_check, $controllink, $dblist_cnt, $userlink,
|
|||||||
while ($uva_row = PMA_DBI_fetch_row($uva_alldbs)) {
|
while ($uva_row = PMA_DBI_fetch_row($uva_alldbs)) {
|
||||||
$dblist[] = $uva_row[0];
|
$dblist[] = $uva_row[0];
|
||||||
} // end while
|
} // end while
|
||||||
} // end if
|
} else {
|
||||||
else {
|
|
||||||
while ($uva_row = PMA_DBI_fetch_row($uva_alldbs)) {
|
while ($uva_row = PMA_DBI_fetch_row($uva_alldbs)) {
|
||||||
$uva_db = $uva_row[0];
|
$uva_db = $uva_row[0];
|
||||||
if (isset($uva_mydbs[$uva_db]) && $uva_mydbs[$uva_db] == 1) {
|
if (isset($uva_mydbs[$uva_db]) && $uva_mydbs[$uva_db] == 1) {
|
||||||
@@ -677,7 +676,9 @@ if (!defined('PMA_MINIMUM_COMMON')) {
|
|||||||
{
|
{
|
||||||
global $cfg;
|
global $cfg;
|
||||||
|
|
||||||
if ($cfg['MySQLManualType'] == 'none' || empty($cfg['MySQLManualBase'])) return '';
|
if ($cfg['MySQLManualType'] == 'none' || empty($cfg['MySQLManualBase'])) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
// Fixup for newly used names:
|
// Fixup for newly used names:
|
||||||
$chapter = str_replace('_', '-', strtolower($chapter));
|
$chapter = str_replace('_', '-', strtolower($chapter));
|
||||||
@@ -685,19 +686,25 @@ if (!defined('PMA_MINIMUM_COMMON')) {
|
|||||||
|
|
||||||
switch ($cfg['MySQLManualType']) {
|
switch ($cfg['MySQLManualType']) {
|
||||||
case 'chapters':
|
case 'chapters':
|
||||||
if (empty($chapter)) $chapter = 'index';
|
if (empty($chapter)) {
|
||||||
|
$chapter = 'index';
|
||||||
|
}
|
||||||
$url = $cfg['MySQLManualBase'] . '/' . $chapter . '.html#' . $link;
|
$url = $cfg['MySQLManualBase'] . '/' . $chapter . '.html#' . $link;
|
||||||
break;
|
break;
|
||||||
case 'big':
|
case 'big':
|
||||||
$url = $cfg['MySQLManualBase'] . '#' . $link;
|
$url = $cfg['MySQLManualBase'] . '#' . $link;
|
||||||
break;
|
break;
|
||||||
case 'searchable':
|
case 'searchable':
|
||||||
if (empty($link)) $link = 'index';
|
if (empty($link)) {
|
||||||
|
$link = 'index';
|
||||||
|
}
|
||||||
$url = $cfg['MySQLManualBase'] . '/' . $link . '.html';
|
$url = $cfg['MySQLManualBase'] . '/' . $link . '.html';
|
||||||
break;
|
break;
|
||||||
case 'viewable':
|
case 'viewable':
|
||||||
default:
|
default:
|
||||||
if (empty($link)) $link = 'index';
|
if (empty($link)) {
|
||||||
|
$link = 'index';
|
||||||
|
}
|
||||||
$mysql = '5.0';
|
$mysql = '5.0';
|
||||||
if (defined('PMA_MYSQL_INT_VERSION')) {
|
if (defined('PMA_MYSQL_INT_VERSION')) {
|
||||||
if (PMA_MYSQL_INT_VERSION < 50000) {
|
if (PMA_MYSQL_INT_VERSION < 50000) {
|
||||||
@@ -1816,8 +1823,7 @@ window.parent.updateTableTitle('<?php echo $uni_tbl; ?>', '<?php echo PMA_jsForm
|
|||||||
if ($tab['text'] == $GLOBALS['strEmpty']
|
if ($tab['text'] == $GLOBALS['strEmpty']
|
||||||
|| $tab['text'] == $GLOBALS['strDrop']) {
|
|| $tab['text'] == $GLOBALS['strDrop']) {
|
||||||
$tab['class'] = 'caution';
|
$tab['class'] = 'caution';
|
||||||
}
|
} elseif (!empty($tab['active'])
|
||||||
elseif (!empty($tab['active'])
|
|
||||||
|| (isset($GLOBALS['active_page'])
|
|| (isset($GLOBALS['active_page'])
|
||||||
&& $GLOBALS['active_page'] == $tab['link'])
|
&& $GLOBALS['active_page'] == $tab['link'])
|
||||||
|| basename($_SERVER['PHP_SELF']) == $tab['link'])
|
|| basename($_SERVER['PHP_SELF']) == $tab['link'])
|
||||||
@@ -1910,12 +1916,10 @@ window.parent.updateTableTitle('<?php echo $uni_tbl; ?>', '<?php echo PMA_jsForm
|
|||||||
function PMA_linkOrButton($url, $message, $tag_params = array(),
|
function PMA_linkOrButton($url, $message, $tag_params = array(),
|
||||||
$new_form = true, $strip_img = false, $target = '')
|
$new_form = true, $strip_img = false, $target = '')
|
||||||
{
|
{
|
||||||
if (!is_array($tag_params))
|
if (! is_array($tag_params)) {
|
||||||
{
|
|
||||||
$tmp = $tag_params;
|
$tmp = $tag_params;
|
||||||
$tag_params = array();
|
$tag_params = array();
|
||||||
if (!empty($tmp))
|
if (!empty($tmp)) {
|
||||||
{
|
|
||||||
$tag_params['onclick'] = 'return confirmLink(this, \'' . $tmp . '\')';
|
$tag_params['onclick'] = 'return confirmLink(this, \'' . $tmp . '\')';
|
||||||
}
|
}
|
||||||
unset($tmp);
|
unset($tmp);
|
||||||
@@ -1939,8 +1943,7 @@ window.parent.updateTableTitle('<?php echo $uni_tbl; ?>', '<?php echo PMA_jsForm
|
|||||||
$ret = "\n" . '<a href="' . $url . '" '
|
$ret = "\n" . '<a href="' . $url . '" '
|
||||||
. implode(' ', $tag_params_strings) . '>'
|
. implode(' ', $tag_params_strings) . '>'
|
||||||
. $message . '</a>' . "\n";
|
. $message . '</a>' . "\n";
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// no spaces (linebreaks) at all
|
// no spaces (linebreaks) at all
|
||||||
// or after the hidden fields
|
// or after the hidden fields
|
||||||
// IE will display them all
|
// IE will display them all
|
||||||
@@ -2103,14 +2106,18 @@ window.parent.updateTableTitle('<?php echo $uni_tbl; ?>', '<?php echo PMA_jsForm
|
|||||||
{
|
{
|
||||||
global $PHP_SELF, $checked_special;
|
global $PHP_SELF, $checked_special;
|
||||||
|
|
||||||
if (!isset($checked_special)) $checked_special = false;
|
if (!isset($checked_special)) {
|
||||||
|
$checked_special = false;
|
||||||
|
}
|
||||||
|
|
||||||
$reported_script_name = basename($PHP_SELF);
|
$reported_script_name = basename($PHP_SELF);
|
||||||
$found_error = false;
|
$found_error = false;
|
||||||
$error_message = '';
|
$error_message = '';
|
||||||
|
|
||||||
foreach ($params AS $param) {
|
foreach ($params AS $param) {
|
||||||
if ($request && $param != 'db' && $param != 'table') $checked_special = true;
|
if ($request && $param != 'db' && $param != 'table') {
|
||||||
|
$checked_special = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($GLOBALS[$param])) {
|
if (!isset($GLOBALS[$param])) {
|
||||||
$error_message .= $reported_script_name . ': Missing parameter: ' . $param . ' <a href="./Documentation.html#faqmissingparameters" target="documentation"> (FAQ 2.8)</a><br />';
|
$error_message .= $reported_script_name . ': Missing parameter: ' . $param . ' <a href="./Documentation.html#faqmissingparameters" target="documentation"> (FAQ 2.8)</a><br />';
|
||||||
|
@@ -68,7 +68,7 @@ if ( true === $cfg['SkipLockedTables'] ) {
|
|||||||
PMA_DBI_free_result($db_info_result);
|
PMA_DBI_free_result($db_info_result);
|
||||||
|
|
||||||
if (isset($sot_cache)) {
|
if (isset($sot_cache)) {
|
||||||
$db_info_result = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . $tbl_group_sql . ';', NULL, PMA_DBI_QUERY_STORE);
|
$db_info_result = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . $tbl_group_sql . ';', null, PMA_DBI_QUERY_STORE);
|
||||||
if ($db_info_result != FALSE && PMA_DBI_num_rows($db_info_result) > 0) {
|
if ($db_info_result != FALSE && PMA_DBI_num_rows($db_info_result) > 0) {
|
||||||
while ($tmp = PMA_DBI_fetch_row($db_info_result)) {
|
while ($tmp = PMA_DBI_fetch_row($db_info_result)) {
|
||||||
if (!isset($sot_cache[$tmp[0]])) {
|
if (!isset($sot_cache[$tmp[0]])) {
|
||||||
|
@@ -19,7 +19,7 @@ if (empty($sub_part)) {
|
|||||||
// priv CREATE TEMPORARY TABLES or LOCK TABLES can do a 'USE mysql'
|
// priv CREATE TEMPORARY TABLES or LOCK TABLES can do a 'USE mysql'
|
||||||
// (even if they cannot see the tables)
|
// (even if they cannot see the tables)
|
||||||
|
|
||||||
$is_superuser = PMA_DBI_try_query('SELECT COUNT(*) FROM mysql.user', NULL, PMA_DBI_QUERY_STORE);
|
$is_superuser = PMA_DBI_try_query('SELECT COUNT(*) FROM mysql.user', null, PMA_DBI_QUERY_STORE);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepares links
|
* Prepares links
|
||||||
|
@@ -21,7 +21,7 @@ if (!isset($is_db) || !$is_db) {
|
|||||||
if (!isset($is_table) || !$is_table) {
|
if (!isset($is_table) || !$is_table) {
|
||||||
// Not a valid table name -> back to the db_details.php
|
// Not a valid table name -> back to the db_details.php
|
||||||
if (isset($table) && strlen($table)) {
|
if (isset($table) && strlen($table)) {
|
||||||
$is_table = PMA_DBI_try_query('SHOW TABLES LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\';', NULL, PMA_DBI_QUERY_STORE);
|
$is_table = PMA_DBI_try_query('SHOW TABLES LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\';', null, PMA_DBI_QUERY_STORE);
|
||||||
}
|
}
|
||||||
if (! isset($table) && ! strlen($table)
|
if (! isset($table) && ! strlen($table)
|
||||||
|| !($is_table && @PMA_DBI_num_rows($is_table))) {
|
|| !($is_table && @PMA_DBI_num_rows($is_table))) {
|
||||||
@@ -31,7 +31,7 @@ if (!isset($is_table) || !$is_table) {
|
|||||||
if (isset($table) && strlen($table)) {
|
if (isset($table) && strlen($table)) {
|
||||||
PMA_DBI_free_result($is_table);
|
PMA_DBI_free_result($is_table);
|
||||||
// SHOW TABLES doesn't show temporary tables, so try select (as it can happen just in case temporary table, it should be fast):
|
// SHOW TABLES doesn't show temporary tables, so try select (as it can happen just in case temporary table, it should be fast):
|
||||||
$is_table2 = PMA_DBI_try_query('SELECT COUNT(*) FROM `' . PMA_sqlAddslashes($table, TRUE) . '`;', NULL, PMA_DBI_QUERY_STORE);
|
$is_table2 = PMA_DBI_try_query('SELECT COUNT(*) FROM `' . PMA_sqlAddslashes($table, TRUE) . '`;', null, PMA_DBI_QUERY_STORE);
|
||||||
$redirect = !($is_table2 && @PMA_DBI_num_rows($is_table2));
|
$redirect = !($is_table2 && @PMA_DBI_num_rows($is_table2));
|
||||||
PMA_DBI_free_result($is_table2);
|
PMA_DBI_free_result($is_table2);
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,9 @@ if (!isset($is_table) || !$is_table) {
|
|||||||
PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . 'db_details.php?' . PMA_generate_common_url($db, '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
|
PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . 'db_details.php?' . PMA_generate_common_url($db, '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($redirect) exit;
|
if ($redirect) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
} elseif (isset($is_table)) {
|
} elseif (isset($is_table)) {
|
||||||
PMA_DBI_free_result($is_table);
|
PMA_DBI_free_result($is_table);
|
||||||
}
|
}
|
||||||
|
@@ -60,7 +60,7 @@ function PMA_DBI_connect($user, $password, $is_controluser = FALSE) {
|
|||||||
return $link;
|
return $link;
|
||||||
}
|
}
|
||||||
|
|
||||||
function PMA_DBI_select_db($dbname, $link = NULL) {
|
function PMA_DBI_select_db($dbname, $link = null) {
|
||||||
if (empty($link)) {
|
if (empty($link)) {
|
||||||
if (isset($GLOBALS['userlink'])) {
|
if (isset($GLOBALS['userlink'])) {
|
||||||
$link = $GLOBALS['userlink'];
|
$link = $GLOBALS['userlink'];
|
||||||
@@ -74,7 +74,7 @@ function PMA_DBI_select_db($dbname, $link = NULL) {
|
|||||||
return mysql_select_db($dbname, $link);
|
return mysql_select_db($dbname, $link);
|
||||||
}
|
}
|
||||||
|
|
||||||
function PMA_DBI_try_query($query, $link = NULL, $options = 0) {
|
function PMA_DBI_try_query($query, $link = null, $options = 0) {
|
||||||
if (empty($link)) {
|
if (empty($link)) {
|
||||||
if (isset($GLOBALS['userlink'])) {
|
if (isset($GLOBALS['userlink'])) {
|
||||||
$link = $GLOBALS['userlink'];
|
$link = $GLOBALS['userlink'];
|
||||||
@@ -106,7 +106,9 @@ function PMA_mysql_fetch_array($result, $type = FALSE) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* No data returned => do not touch it */
|
/* No data returned => do not touch it */
|
||||||
if (! $data) return $data;
|
if (! $data) {
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
if (!defined('PMA_MYSQL_INT_VERSION') || PMA_MYSQL_INT_VERSION >= 40100
|
if (!defined('PMA_MYSQL_INT_VERSION') || PMA_MYSQL_INT_VERSION >= 40100
|
||||||
|| !(isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] && $allow_recoding)) {
|
|| !(isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] && $allow_recoding)) {
|
||||||
@@ -121,11 +123,19 @@ function PMA_mysql_fetch_array($result, $type = FALSE) {
|
|||||||
$flags = mysql_field_flags($result, $i);
|
$flags = mysql_field_flags($result, $i);
|
||||||
/* Field is BINARY (either marked manually, or it is BLOB) => do not convert it */
|
/* Field is BINARY (either marked manually, or it is BLOB) => do not convert it */
|
||||||
if (stristr($flags, 'BINARY')) {
|
if (stristr($flags, 'BINARY')) {
|
||||||
if (isset($data[$i])) $ret[$i] = $data[$i];
|
if (isset($data[$i])) {
|
||||||
if (isset($data[$name])) $ret[PMA_convert_display_charset($name)] = $data[$name];
|
$ret[$i] = $data[$i];
|
||||||
|
}
|
||||||
|
if (isset($data[$name])) {
|
||||||
|
$ret[PMA_convert_display_charset($name)] = $data[$name];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (isset($data[$i])) $ret[$i] = PMA_convert_display_charset($data[$i]);
|
if (isset($data[$i])) {
|
||||||
if (isset($data[$name])) $ret[PMA_convert_display_charset($name)] = PMA_convert_display_charset($data[$name]);
|
$ret[$i] = PMA_convert_display_charset($data[$i]);
|
||||||
|
}
|
||||||
|
if (isset($data[$name])) {
|
||||||
|
$ret[PMA_convert_display_charset($name)] = PMA_convert_display_charset($data[$name]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
@@ -165,8 +175,9 @@ function PMA_DBI_free_result() {
|
|||||||
* @param resource $link mysql link
|
* @param resource $link mysql link
|
||||||
* @return string type of connection used
|
* @return string type of connection used
|
||||||
*/
|
*/
|
||||||
function PMA_DBI_get_host_info( $link = NULL ) {
|
function PMA_DBI_get_host_info($link = null)
|
||||||
if ( NULL === $link ) {
|
{
|
||||||
|
if (null === $link) {
|
||||||
if (isset($GLOBALS['userlink'])) {
|
if (isset($GLOBALS['userlink'])) {
|
||||||
$link = $GLOBALS['userlink'];
|
$link = $GLOBALS['userlink'];
|
||||||
} else {
|
} else {
|
||||||
@@ -183,8 +194,9 @@ function PMA_DBI_get_host_info( $link = NULL ) {
|
|||||||
* @param resource $link mysql link
|
* @param resource $link mysql link
|
||||||
* @return integer version of the MySQL protocol used
|
* @return integer version of the MySQL protocol used
|
||||||
*/
|
*/
|
||||||
function PMA_DBI_get_proto_info( $link = NULL ) {
|
function PMA_DBI_get_proto_info($link = null)
|
||||||
if ( NULL === $link ) {
|
{
|
||||||
|
if (null === $link) {
|
||||||
if (isset($GLOBALS['userlink'])) {
|
if (isset($GLOBALS['userlink'])) {
|
||||||
$link = $GLOBALS['userlink'];
|
$link = $GLOBALS['userlink'];
|
||||||
} else {
|
} else {
|
||||||
@@ -219,9 +231,10 @@ function PMA_DBI_get_client_info() {
|
|||||||
* @param resource $link mysql link
|
* @param resource $link mysql link
|
||||||
* @return string|boolean $error or false
|
* @return string|boolean $error or false
|
||||||
*/
|
*/
|
||||||
function PMA_DBI_getError( $link = NULL ) {
|
function PMA_DBI_getError($link = null)
|
||||||
|
{
|
||||||
unset($GLOBALS['errno']);
|
unset($GLOBALS['errno']);
|
||||||
if ( NULL === $link && isset( $GLOBALS['userlink'] ) ) {
|
if (null === $link && isset($GLOBALS['userlink'])) {
|
||||||
$link =& $GLOBALS['userlink'];
|
$link =& $GLOBALS['userlink'];
|
||||||
|
|
||||||
// Do not stop now. On the initial connection, we don't have a $link,
|
// Do not stop now. On the initial connection, we don't have a $link,
|
||||||
@@ -230,7 +243,7 @@ function PMA_DBI_getError( $link = NULL ) {
|
|||||||
// return FALSE;
|
// return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( NULL !== $link ) {
|
if (null !== $link) {
|
||||||
$error_number = mysql_errno($link);
|
$error_number = mysql_errno($link);
|
||||||
$error_message = mysql_error($link);
|
$error_message = mysql_error($link);
|
||||||
} else {
|
} else {
|
||||||
@@ -261,7 +274,8 @@ function PMA_DBI_getError( $link = NULL ) {
|
|||||||
return $error;
|
return $error;
|
||||||
}
|
}
|
||||||
|
|
||||||
function PMA_DBI_close($link = NULL) {
|
function PMA_DBI_close($link = null)
|
||||||
|
{
|
||||||
if (empty($link)) {
|
if (empty($link)) {
|
||||||
if (isset($GLOBALS['userlink'])) {
|
if (isset($GLOBALS['userlink'])) {
|
||||||
$link = $GLOBALS['userlink'];
|
$link = $GLOBALS['userlink'];
|
||||||
@@ -280,7 +294,8 @@ function PMA_DBI_num_rows($result) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function PMA_DBI_insert_id($link = NULL) {
|
function PMA_DBI_insert_id($link = null)
|
||||||
|
{
|
||||||
if (empty($link)) {
|
if (empty($link)) {
|
||||||
if (isset($GLOBALS['userlink'])) {
|
if (isset($GLOBALS['userlink'])) {
|
||||||
$link = $GLOBALS['userlink'];
|
$link = $GLOBALS['userlink'];
|
||||||
@@ -291,7 +306,8 @@ function PMA_DBI_insert_id($link = NULL) {
|
|||||||
return mysql_insert_id($link);
|
return mysql_insert_id($link);
|
||||||
}
|
}
|
||||||
|
|
||||||
function PMA_DBI_affected_rows($link = NULL) {
|
function PMA_DBI_affected_rows($link = null)
|
||||||
|
{
|
||||||
if (empty($link)) {
|
if (empty($link)) {
|
||||||
if (isset($GLOBALS['userlink'])) {
|
if (isset($GLOBALS['userlink'])) {
|
||||||
$link = $GLOBALS['userlink'];
|
$link = $GLOBALS['userlink'];
|
||||||
|
@@ -31,7 +31,8 @@ define('NUM_FLAG', 32768);
|
|||||||
define('PART_KEY_FLAG', 16384);
|
define('PART_KEY_FLAG', 16384);
|
||||||
define('UNIQUE_FLAG', 65536);
|
define('UNIQUE_FLAG', 65536);
|
||||||
|
|
||||||
function PMA_DBI_connect($user, $password, $is_controluser = FALSE) {
|
function PMA_DBI_connect($user, $password, $is_controluser = FALSE)
|
||||||
|
{
|
||||||
global $cfg, $php_errormsg;
|
global $cfg, $php_errormsg;
|
||||||
|
|
||||||
$server_port = (empty($cfg['Server']['port']))
|
$server_port = (empty($cfg['Server']['port']))
|
||||||
@@ -44,7 +45,7 @@ function PMA_DBI_connect($user, $password, $is_controluser = FALSE) {
|
|||||||
|
|
||||||
// NULL enables connection to the default socket
|
// NULL enables connection to the default socket
|
||||||
$server_socket = (empty($cfg['Server']['socket']))
|
$server_socket = (empty($cfg['Server']['socket']))
|
||||||
? NULL
|
? null
|
||||||
: $cfg['Server']['socket'];
|
: $cfg['Server']['socket'];
|
||||||
|
|
||||||
$link = mysqli_init();
|
$link = mysqli_init();
|
||||||
@@ -64,7 +65,8 @@ function PMA_DBI_connect($user, $password, $is_controluser = FALSE) {
|
|||||||
return $link;
|
return $link;
|
||||||
}
|
}
|
||||||
|
|
||||||
function PMA_DBI_select_db($dbname, $link = NULL) {
|
function PMA_DBI_select_db($dbname, $link = null)
|
||||||
|
{
|
||||||
if (empty($link)) {
|
if (empty($link)) {
|
||||||
if (isset($GLOBALS['userlink'])) {
|
if (isset($GLOBALS['userlink'])) {
|
||||||
$link = $GLOBALS['userlink'];
|
$link = $GLOBALS['userlink'];
|
||||||
@@ -78,7 +80,8 @@ function PMA_DBI_select_db($dbname, $link = NULL) {
|
|||||||
return mysqli_select_db($link, $dbname);
|
return mysqli_select_db($link, $dbname);
|
||||||
}
|
}
|
||||||
|
|
||||||
function PMA_DBI_try_query($query, $link = NULL, $options = 0) {
|
function PMA_DBI_try_query($query, $link = null, $options = 0)
|
||||||
|
{
|
||||||
if ($options == ($options | PMA_DBI_QUERY_STORE)) {
|
if ($options == ($options | PMA_DBI_QUERY_STORE)) {
|
||||||
$method = MYSQLI_STORE_RESULT;
|
$method = MYSQLI_STORE_RESULT;
|
||||||
} elseif ($options == ($options | PMA_DBI_QUERY_UNBUFFERED)) {
|
} elseif ($options == ($options | PMA_DBI_QUERY_UNBUFFERED)) {
|
||||||
@@ -107,7 +110,8 @@ function PMA_DBI_try_query($query, $link = NULL, $options = 0) {
|
|||||||
|
|
||||||
// The following function is meant for internal use only.
|
// The following function is meant for internal use only.
|
||||||
// Do not call it from outside this library!
|
// Do not call it from outside this library!
|
||||||
function PMA_mysqli_fetch_array($result, $type = FALSE) {
|
function PMA_mysqli_fetch_array($result, $type = FALSE)
|
||||||
|
{
|
||||||
global $cfg, $allow_recoding, $charset, $convcharset;
|
global $cfg, $allow_recoding, $charset, $convcharset;
|
||||||
|
|
||||||
if ($type != FALSE) {
|
if ($type != FALSE) {
|
||||||
@@ -117,7 +121,9 @@ function PMA_mysqli_fetch_array($result, $type = FALSE) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* No data returned => do not touch it */
|
/* No data returned => do not touch it */
|
||||||
if (! $data) return $data;
|
if (! $data) {
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
if (!defined('PMA_MYSQL_INT_VERSION') || PMA_MYSQL_INT_VERSION >= 40100
|
if (!defined('PMA_MYSQL_INT_VERSION') || PMA_MYSQL_INT_VERSION >= 40100
|
||||||
|| !(isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] && $allow_recoding)) {
|
|| !(isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] && $allow_recoding)) {
|
||||||
@@ -167,15 +173,18 @@ function PMA_mysqli_fetch_array($result, $type = FALSE) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function PMA_DBI_fetch_array($result) {
|
function PMA_DBI_fetch_array($result)
|
||||||
|
{
|
||||||
return PMA_mysqli_fetch_array($result, MYSQLI_BOTH);
|
return PMA_mysqli_fetch_array($result, MYSQLI_BOTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
function PMA_DBI_fetch_assoc($result) {
|
function PMA_DBI_fetch_assoc($result)
|
||||||
|
{
|
||||||
return PMA_mysqli_fetch_array($result, MYSQLI_ASSOC);
|
return PMA_mysqli_fetch_array($result, MYSQLI_ASSOC);
|
||||||
}
|
}
|
||||||
|
|
||||||
function PMA_DBI_fetch_row($result) {
|
function PMA_DBI_fetch_row($result)
|
||||||
|
{
|
||||||
return PMA_mysqli_fetch_array($result, MYSQLI_NUM);
|
return PMA_mysqli_fetch_array($result, MYSQLI_NUM);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,7 +193,8 @@ function PMA_DBI_fetch_row($result) {
|
|||||||
*
|
*
|
||||||
* @param result $result,... one or more mysql result resources
|
* @param result $result,... one or more mysql result resources
|
||||||
*/
|
*/
|
||||||
function PMA_DBI_free_result() {
|
function PMA_DBI_free_result()
|
||||||
|
{
|
||||||
foreach (func_get_args() as $result) {
|
foreach (func_get_args() as $result) {
|
||||||
if (is_object($result)
|
if (is_object($result)
|
||||||
&& is_a($result, 'mysqli_result')) {
|
&& is_a($result, 'mysqli_result')) {
|
||||||
@@ -200,8 +210,9 @@ function PMA_DBI_free_result() {
|
|||||||
* @param resource $link mysql link
|
* @param resource $link mysql link
|
||||||
* @return string type of connection used
|
* @return string type of connection used
|
||||||
*/
|
*/
|
||||||
function PMA_DBI_get_host_info( $link = NULL ) {
|
function PMA_DBI_get_host_info($link = null)
|
||||||
if ( NULL === $link ) {
|
{
|
||||||
|
if (null === $link) {
|
||||||
if (isset($GLOBALS['userlink'])) {
|
if (isset($GLOBALS['userlink'])) {
|
||||||
$link = $GLOBALS['userlink'];
|
$link = $GLOBALS['userlink'];
|
||||||
} else {
|
} else {
|
||||||
@@ -218,8 +229,9 @@ function PMA_DBI_get_host_info( $link = NULL ) {
|
|||||||
* @param resource $link mysql link
|
* @param resource $link mysql link
|
||||||
* @return integer version of the MySQL protocol used
|
* @return integer version of the MySQL protocol used
|
||||||
*/
|
*/
|
||||||
function PMA_DBI_get_proto_info( $link = NULL ) {
|
function PMA_DBI_get_proto_info( $link = null )
|
||||||
if ( NULL === $link ) {
|
{
|
||||||
|
if (null === $link) {
|
||||||
if (isset($GLOBALS['userlink'])) {
|
if (isset($GLOBALS['userlink'])) {
|
||||||
$link = $GLOBALS['userlink'];
|
$link = $GLOBALS['userlink'];
|
||||||
} else {
|
} else {
|
||||||
@@ -256,10 +268,11 @@ function PMA_DBI_get_client_info() {
|
|||||||
* @param resource $link mysql link
|
* @param resource $link mysql link
|
||||||
* @return string|boolean $error or false
|
* @return string|boolean $error or false
|
||||||
*/
|
*/
|
||||||
function PMA_DBI_getError( $link = NULL ) {
|
function PMA_DBI_getError($link = null)
|
||||||
|
{
|
||||||
unset($GLOBALS['errno']);
|
unset($GLOBALS['errno']);
|
||||||
|
|
||||||
if ( NULL === $link && isset( $GLOBALS['userlink'] ) ) {
|
if (null === $link && isset($GLOBALS['userlink'])) {
|
||||||
$link =& $GLOBALS['userlink'];
|
$link =& $GLOBALS['userlink'];
|
||||||
// Do not stop now. We still can get the error code
|
// Do not stop now. We still can get the error code
|
||||||
// with mysqli_connect_errno()
|
// with mysqli_connect_errno()
|
||||||
@@ -267,7 +280,7 @@ function PMA_DBI_getError( $link = NULL ) {
|
|||||||
// return false;
|
// return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( NULL !== $link ) {
|
if (null !== $link) {
|
||||||
$error_number = mysqli_errno($link);
|
$error_number = mysqli_errno($link);
|
||||||
$error_message = mysqli_error($link);
|
$error_message = mysqli_error($link);
|
||||||
} else {
|
} else {
|
||||||
@@ -295,7 +308,8 @@ function PMA_DBI_getError( $link = NULL ) {
|
|||||||
return $error;
|
return $error;
|
||||||
}
|
}
|
||||||
|
|
||||||
function PMA_DBI_close($link = NULL) {
|
function PMA_DBI_close($link = null)
|
||||||
|
{
|
||||||
if (empty($link)) {
|
if (empty($link)) {
|
||||||
if (isset($GLOBALS['userlink'])) {
|
if (isset($GLOBALS['userlink'])) {
|
||||||
$link = $GLOBALS['userlink'];
|
$link = $GLOBALS['userlink'];
|
||||||
@@ -306,7 +320,8 @@ function PMA_DBI_close($link = NULL) {
|
|||||||
return @mysqli_close($link);
|
return @mysqli_close($link);
|
||||||
}
|
}
|
||||||
|
|
||||||
function PMA_DBI_num_rows($result) {
|
function PMA_DBI_num_rows($result)
|
||||||
|
{
|
||||||
// see the note for PMA_DBI_try_query();
|
// see the note for PMA_DBI_try_query();
|
||||||
if (!is_bool($result)) {
|
if (!is_bool($result)) {
|
||||||
return @mysqli_num_rows($result);
|
return @mysqli_num_rows($result);
|
||||||
@@ -315,7 +330,8 @@ function PMA_DBI_num_rows($result) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function PMA_DBI_insert_id($link = '') {
|
function PMA_DBI_insert_id($link = '')
|
||||||
|
{
|
||||||
if (empty($link)) {
|
if (empty($link)) {
|
||||||
if (isset($GLOBALS['userlink'])) {
|
if (isset($GLOBALS['userlink'])) {
|
||||||
$link = $GLOBALS['userlink'];
|
$link = $GLOBALS['userlink'];
|
||||||
@@ -326,7 +342,8 @@ function PMA_DBI_insert_id($link = '') {
|
|||||||
return mysqli_insert_id($link);
|
return mysqli_insert_id($link);
|
||||||
}
|
}
|
||||||
|
|
||||||
function PMA_DBI_affected_rows($link = NULL) {
|
function PMA_DBI_affected_rows($link = null)
|
||||||
|
{
|
||||||
if (empty($link)) {
|
if (empty($link)) {
|
||||||
if (isset($GLOBALS['userlink'])) {
|
if (isset($GLOBALS['userlink'])) {
|
||||||
$link = $GLOBALS['userlink'];
|
$link = $GLOBALS['userlink'];
|
||||||
@@ -337,7 +354,8 @@ function PMA_DBI_affected_rows($link = NULL) {
|
|||||||
return mysqli_affected_rows($link);
|
return mysqli_affected_rows($link);
|
||||||
}
|
}
|
||||||
|
|
||||||
function PMA_DBI_get_fields_meta($result) {
|
function PMA_DBI_get_fields_meta($result)
|
||||||
|
{
|
||||||
// Build an associative array for a type look up
|
// Build an associative array for a type look up
|
||||||
$typeAr = Array();
|
$typeAr = Array();
|
||||||
$typeAr[MYSQLI_TYPE_DECIMAL] = 'real';
|
$typeAr[MYSQLI_TYPE_DECIMAL] = 'real';
|
||||||
@@ -392,23 +410,27 @@ function PMA_DBI_get_fields_meta($result) {
|
|||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
function PMA_DBI_num_fields($result) {
|
function PMA_DBI_num_fields($result)
|
||||||
|
{
|
||||||
return mysqli_num_fields($result);
|
return mysqli_num_fields($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
function PMA_DBI_field_len($result, $i) {
|
function PMA_DBI_field_len($result, $i)
|
||||||
|
{
|
||||||
$info = mysqli_fetch_field_direct($result, $i);
|
$info = mysqli_fetch_field_direct($result, $i);
|
||||||
// stdClass::$length will be integrated in
|
// stdClass::$length will be integrated in
|
||||||
// mysqli-ext when mysql4.1 has been released.
|
// mysqli-ext when mysql4.1 has been released.
|
||||||
return @$info->length;
|
return @$info->length;
|
||||||
}
|
}
|
||||||
|
|
||||||
function PMA_DBI_field_name($result, $i) {
|
function PMA_DBI_field_name($result, $i)
|
||||||
|
{
|
||||||
$info = mysqli_fetch_field_direct($result, $i);
|
$info = mysqli_fetch_field_direct($result, $i);
|
||||||
return $info->name;
|
return $info->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
function PMA_DBI_field_flags($result, $i) {
|
function PMA_DBI_field_flags($result, $i)
|
||||||
|
{
|
||||||
$f = mysqli_fetch_field_direct($result, $i);
|
$f = mysqli_fetch_field_direct($result, $i);
|
||||||
$f = $f->flags;
|
$f = $f->flags;
|
||||||
$flags = '';
|
$flags = '';
|
||||||
|
@@ -17,7 +17,7 @@ if ($is_create_db_priv) {
|
|||||||
<?php
|
<?php
|
||||||
if (PMA_MYSQL_INT_VERSION >= 40101) {
|
if (PMA_MYSQL_INT_VERSION >= 40101) {
|
||||||
require_once('./libraries/mysql_charsets.lib.php');
|
require_once('./libraries/mysql_charsets.lib.php');
|
||||||
echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'db_collation', NULL, NULL, TRUE, 5);
|
echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'db_collation', null, null, TRUE, 5);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<input type="submit" value="<?php echo $strCreate; ?>" id="buttonGo" />
|
<input type="submit" value="<?php echo $strCreate; ?>" id="buttonGo" />
|
||||||
|
@@ -49,7 +49,9 @@ echo PMA_pluginGetJavascript($import_list);
|
|||||||
if (!empty($cfg['UploadDir'])) {
|
if (!empty($cfg['UploadDir'])) {
|
||||||
$extensions = '';
|
$extensions = '';
|
||||||
foreach ($import_list as $key => $val) {
|
foreach ($import_list as $key => $val) {
|
||||||
if (!empty($extensions)) $extensions .= '|';
|
if (!empty($extensions)) {
|
||||||
|
$extensions .= '|';
|
||||||
|
}
|
||||||
$extensions .= $val['extension'];
|
$extensions .= $val['extension'];
|
||||||
}
|
}
|
||||||
$matcher = '@\.(' . $extensions . ')(\.(' . PMA_supportedDecompressions() . '))?$@';
|
$matcher = '@\.(' . $extensions . ')(\.(' . PMA_supportedDecompressions() . '))?$@';
|
||||||
@@ -101,9 +103,15 @@ echo '</div>' . "\n";
|
|||||||
// zip, gzip and bzip2 encode features
|
// zip, gzip and bzip2 encode features
|
||||||
$compressions = $strNone;
|
$compressions = $strNone;
|
||||||
|
|
||||||
if ($cfg['GZipDump'] && @function_exists('gzopen')) $compressions .= ', gzip';
|
if ($cfg['GZipDump'] && @function_exists('gzopen')) {
|
||||||
if ($cfg['BZipDump'] && @function_exists('bzopen')) $compressions .= ', bzip2';
|
$compressions .= ', gzip';
|
||||||
if ($cfg['ZipDump'] && @function_exists('gzinflate')) $compressions .= ', zip';
|
}
|
||||||
|
if ($cfg['BZipDump'] && @function_exists('bzopen')) {
|
||||||
|
$compressions .= ', bzip2';
|
||||||
|
}
|
||||||
|
if ($cfg['ZipDump'] && @function_exists('gzinflate')) {
|
||||||
|
$compressions .= ', zip';
|
||||||
|
}
|
||||||
|
|
||||||
// We don't have show anything about compression, when no supported
|
// We don't have show anything about compression, when no supported
|
||||||
if ($compressions != $strNone) {
|
if ($compressions != $strNone) {
|
||||||
|
@@ -107,8 +107,7 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
|
|||||||
if (isset($which[1]) && strpos(' ' . strtoupper($which[1]), 'PROCESSLIST') > 0) {
|
if (isset($which[1]) && strpos(' ' . strtoupper($which[1]), 'PROCESSLIST') > 0) {
|
||||||
$do_display['edit_lnk'] = 'nn'; // no edit link
|
$do_display['edit_lnk'] = 'nn'; // no edit link
|
||||||
$do_display['del_lnk'] = 'kp'; // "kill process" type edit link
|
$do_display['del_lnk'] = 'kp'; // "kill process" type edit link
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Default case -> no links
|
// Default case -> no links
|
||||||
$do_display['edit_lnk'] = 'nn'; // no edit link
|
$do_display['edit_lnk'] = 'nn'; // no edit link
|
||||||
$do_display['del_lnk'] = 'nn'; // no delete link
|
$do_display['del_lnk'] = 'nn'; // no delete link
|
||||||
@@ -155,8 +154,7 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
|
|||||||
// 3. Gets the total number of rows if it is unknown
|
// 3. Gets the total number of rows if it is unknown
|
||||||
if (isset($unlim_num_rows) && $unlim_num_rows != '') {
|
if (isset($unlim_num_rows) && $unlim_num_rows != '') {
|
||||||
$the_total = $unlim_num_rows;
|
$the_total = $unlim_num_rows;
|
||||||
}
|
} elseif (($do_display['nav_bar'] == '1' || $do_display['sort_lnk'] == '1')
|
||||||
else if (($do_display['nav_bar'] == '1' || $do_display['sort_lnk'] == '1')
|
|
||||||
&& (isset($db) && strlen($db) && !empty($table))) {
|
&& (isset($db) && strlen($db) && !empty($table))) {
|
||||||
$the_total = PMA_countRecords($db, $table, TRUE);
|
$the_total = PMA_countRecords($db, $table, TRUE);
|
||||||
}
|
}
|
||||||
@@ -526,9 +524,15 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|||||||
|
|
||||||
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
||||||
$span = $fields_cnt;
|
$span = $fields_cnt;
|
||||||
if ($is_display['edit_lnk'] != 'nn') $span++;
|
if ($is_display['edit_lnk'] != 'nn') {
|
||||||
if ($is_display['del_lnk'] != 'nn') $span++;
|
$span++;
|
||||||
if ($is_display['del_lnk'] != 'kp' && $is_display['del_lnk'] != 'nn') $span++;
|
}
|
||||||
|
if ($is_display['del_lnk'] != 'nn') {
|
||||||
|
$span++;
|
||||||
|
}
|
||||||
|
if ($is_display['del_lnk'] != 'kp' && $is_display['del_lnk'] != 'nn') {
|
||||||
|
$span++;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$span = $num_rows + floor($num_rows/$repeat_cells) + 1;
|
$span = $num_rows + floor($num_rows/$repeat_cells) + 1;
|
||||||
}
|
}
|
||||||
@@ -825,7 +829,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|||||||
|
|
||||||
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
||||||
?>
|
?>
|
||||||
<th <?php echo $column_style; ?> <?php if ($disp_direction == 'horizontalflipped') echo 'valign="bottom"'; ?>>
|
<th <?php echo $column_style; ?> <?php if ($disp_direction == 'horizontalflipped') { echo 'valign="bottom"'; } ?>>
|
||||||
<?php echo $order_link; ?>
|
<?php echo $order_link; ?>
|
||||||
<?php echo $comments; ?>
|
<?php echo $comments; ?>
|
||||||
</th>
|
</th>
|
||||||
@@ -841,7 +845,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|||||||
else {
|
else {
|
||||||
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
||||||
?>
|
?>
|
||||||
<th <?php echo $column_style; ?> <?php if ($disp_direction == 'horizontalflipped') echo 'valign="bottom"'; ?> <?php echo ($disp_direction == 'horizontalflipped' && $GLOBALS['cfg']['HeaderFlipType'] == 'css' ? 'style="direction: ltr; writing-mode: tb-rl;"' : ''); ?>>
|
<th <?php echo $column_style; ?> <?php if ($disp_direction == 'horizontalflipped') { echo 'valign="bottom"'; } ?> <?php echo ($disp_direction == 'horizontalflipped' && $GLOBALS['cfg']['HeaderFlipType'] == 'css' ? 'style="direction: ltr; writing-mode: tb-rl;"' : ''); ?>>
|
||||||
<?php echo ($disp_direction == 'horizontalflipped' && $GLOBALS['cfg']['HeaderFlipType'] == 'fake'? PMA_flipstring(htmlspecialchars($fields_meta[$i]->name), "<br />\n") : htmlspecialchars($fields_meta[$i]->name)) . "\n"; ?>
|
<?php echo ($disp_direction == 'horizontalflipped' && $GLOBALS['cfg']['HeaderFlipType'] == 'fake'? PMA_flipstring(htmlspecialchars($fields_meta[$i]->name), "<br />\n") : htmlspecialchars($fields_meta[$i]->name)) . "\n"; ?>
|
||||||
<?php echo $comments; ?>
|
<?php echo $comments; ?>
|
||||||
</th>
|
</th>
|
||||||
@@ -1245,16 +1249,14 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
|||||||
. ' FROM ' . PMA_backquote($map[$meta->name][3]) . '.' . PMA_backquote($map[$meta->name][0])
|
. ' FROM ' . PMA_backquote($map[$meta->name][3]) . '.' . PMA_backquote($map[$meta->name][0])
|
||||||
. ' WHERE ' . PMA_backquote($map[$meta->name][1])
|
. ' WHERE ' . PMA_backquote($map[$meta->name][1])
|
||||||
. ' = ' . $row[$i];
|
. ' = ' . $row[$i];
|
||||||
$dispresult = PMA_DBI_try_query($dispsql, NULL, PMA_DBI_QUERY_STORE);
|
$dispresult = PMA_DBI_try_query($dispsql, null, PMA_DBI_QUERY_STORE);
|
||||||
if ($dispresult && PMA_DBI_num_rows($dispresult) > 0) {
|
if ($dispresult && PMA_DBI_num_rows($dispresult) > 0) {
|
||||||
list($dispval) = PMA_DBI_fetch_row($dispresult, 0);
|
list($dispval) = PMA_DBI_fetch_row($dispresult, 0);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$dispval = $GLOBALS['strLinkNotFound'];
|
$dispval = $GLOBALS['strLinkNotFound'];
|
||||||
}
|
}
|
||||||
@PMA_DBI_free_result($dispresult);
|
@PMA_DBI_free_result($dispresult);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$dispval = '';
|
$dispval = '';
|
||||||
} // end if... else...
|
} // end if... else...
|
||||||
|
|
||||||
@@ -1371,16 +1373,14 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
|||||||
. ' FROM ' . PMA_backquote($map[$meta->name][3]) . '.' . PMA_backquote($map[$meta->name][0])
|
. ' FROM ' . PMA_backquote($map[$meta->name][3]) . '.' . PMA_backquote($map[$meta->name][0])
|
||||||
. ' WHERE ' . PMA_backquote($map[$meta->name][1])
|
. ' WHERE ' . PMA_backquote($map[$meta->name][1])
|
||||||
. ' = \'' . PMA_sqlAddslashes($row[$i]) . '\'';
|
. ' = \'' . PMA_sqlAddslashes($row[$i]) . '\'';
|
||||||
$dispresult = PMA_DBI_try_query($dispsql, NULL, PMA_DBI_QUERY_STORE);
|
$dispresult = PMA_DBI_try_query($dispsql, null, PMA_DBI_QUERY_STORE);
|
||||||
if ($dispresult && PMA_DBI_num_rows($dispresult) > 0) {
|
if ($dispresult && PMA_DBI_num_rows($dispresult) > 0) {
|
||||||
list($dispval) = PMA_DBI_fetch_row($dispresult);
|
list($dispval) = PMA_DBI_fetch_row($dispresult);
|
||||||
@PMA_DBI_free_result($dispresult);
|
@PMA_DBI_free_result($dispresult);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$dispval = $GLOBALS['strLinkNotFound'];
|
$dispval = $GLOBALS['strLinkNotFound'];
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$dispval = '';
|
$dispval = '';
|
||||||
}
|
}
|
||||||
$title = (!empty($dispval))? ' title="' . htmlspecialchars($dispval) . '"' : '';
|
$title = (!empty($dispval))? ' title="' . htmlspecialchars($dispval) . '"' : '';
|
||||||
|
@@ -124,7 +124,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
|||||||
global $escaped;
|
global $escaped;
|
||||||
|
|
||||||
// Gets the data from the database
|
// Gets the data from the database
|
||||||
$result = PMA_DBI_query($sql_query, NULL, PMA_DBI_QUERY_UNBUFFERED);
|
$result = PMA_DBI_query($sql_query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||||
$fields_cnt = PMA_DBI_num_fields($result);
|
$fields_cnt = PMA_DBI_num_fields($result);
|
||||||
|
|
||||||
// If required, get fields name at the first line
|
// If required, get fields name at the first line
|
||||||
@@ -141,7 +141,9 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
|||||||
$schema_insert .= $export_separator;
|
$schema_insert .= $export_separator;
|
||||||
} // end for
|
} // end for
|
||||||
$schema_insert =trim(substr($schema_insert, 0, -1));
|
$schema_insert =trim(substr($schema_insert, 0, -1));
|
||||||
if (!PMA_exportOutputHandler($schema_insert . $add_character)) return FALSE;
|
if (!PMA_exportOutputHandler($schema_insert . $add_character)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
} // end if
|
} // end if
|
||||||
|
|
||||||
// Format the data
|
// Format the data
|
||||||
@@ -150,8 +152,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
|||||||
for ($j = 0; $j < $fields_cnt; $j++) {
|
for ($j = 0; $j < $fields_cnt; $j++) {
|
||||||
if (!isset($row[$j]) || is_null($row[$j])) {
|
if (!isset($row[$j]) || is_null($row[$j])) {
|
||||||
$schema_insert .= $GLOBALS[$what . '_replace_null'];
|
$schema_insert .= $GLOBALS[$what . '_replace_null'];
|
||||||
}
|
} elseif ($row[$j] == '0' || $row[$j] != '') {
|
||||||
else if ($row[$j] == '0' || $row[$j] != '') {
|
|
||||||
// loic1 : always enclose fields
|
// loic1 : always enclose fields
|
||||||
if ($what == 'excel') {
|
if ($what == 'excel') {
|
||||||
$row[$j] = ereg_replace("\015(\012)?", "\012", $row[$j]);
|
$row[$j] = ereg_replace("\015(\012)?", "\012", $row[$j]);
|
||||||
@@ -163,8 +164,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
|||||||
. str_replace($enclosed, $escaped . $enclosed, $row[$j])
|
. str_replace($enclosed, $escaped . $enclosed, $row[$j])
|
||||||
. $enclosed;
|
. $enclosed;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$schema_insert .= '';
|
$schema_insert .= '';
|
||||||
}
|
}
|
||||||
if ($j < $fields_cnt-1) {
|
if ($j < $fields_cnt-1) {
|
||||||
@@ -172,7 +172,9 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
|||||||
}
|
}
|
||||||
} // end for
|
} // end for
|
||||||
|
|
||||||
if (!PMA_exportOutputHandler($schema_insert . $add_character)) return FALSE;
|
if (!PMA_exportOutputHandler($schema_insert . $add_character)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
} // end while
|
} // end while
|
||||||
PMA_DBI_free_result($result);
|
PMA_DBI_free_result($result);
|
||||||
|
|
||||||
|
@@ -122,7 +122,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
|||||||
global $what;
|
global $what;
|
||||||
|
|
||||||
// Gets the data from the database
|
// Gets the data from the database
|
||||||
$result = PMA_DBI_query($sql_query, NULL, PMA_DBI_QUERY_UNBUFFERED);
|
$result = PMA_DBI_query($sql_query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||||
$fields_cnt = PMA_DBI_num_fields($result);
|
$fields_cnt = PMA_DBI_num_fields($result);
|
||||||
|
|
||||||
// If required, get fields name at the first line
|
// If required, get fields name at the first line
|
||||||
@@ -132,7 +132,9 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
|||||||
$schema_insert .= '<td class=xl2216681 nowrap><b>' . htmlspecialchars(stripslashes(PMA_DBI_field_name($result, $i))) . '</b></td>';
|
$schema_insert .= '<td class=xl2216681 nowrap><b>' . htmlspecialchars(stripslashes(PMA_DBI_field_name($result, $i))) . '</b></td>';
|
||||||
} // end for
|
} // end for
|
||||||
$schema_insert .= '</tr>';
|
$schema_insert .= '</tr>';
|
||||||
if (!PMA_exportOutputHandler($schema_insert)) return FALSE;
|
if (!PMA_exportOutputHandler($schema_insert)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
} // end if
|
} // end if
|
||||||
|
|
||||||
// Format the data
|
// Format the data
|
||||||
@@ -149,7 +151,9 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
|||||||
$schema_insert .= '<td class=xl2216681 nowrap>' . htmlspecialchars($value) . '</td>';
|
$schema_insert .= '<td class=xl2216681 nowrap>' . htmlspecialchars($value) . '</td>';
|
||||||
} // end for
|
} // end for
|
||||||
$schema_insert .= '</tr>';
|
$schema_insert .= '</tr>';
|
||||||
if (!PMA_exportOutputHandler($schema_insert)) return FALSE;
|
if (!PMA_exportOutputHandler($schema_insert)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
} // end while
|
} // end while
|
||||||
PMA_DBI_free_result($result);
|
PMA_DBI_free_result($result);
|
||||||
|
|
||||||
|
@@ -101,14 +101,19 @@ function PMA_exportDBCreate($db) {
|
|||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
|
||||||
|
{
|
||||||
global $what;
|
global $what;
|
||||||
|
|
||||||
if (!PMA_exportOutputHandler('<h2>' . $GLOBALS['strDumpingData'] . ' ' .$table . '</h2>')) return FALSE;
|
if (!PMA_exportOutputHandler('<h2>' . $GLOBALS['strDumpingData'] . ' ' . $table . '</h2>')) {
|
||||||
if (!PMA_exportOutputHandler('<table class="width100" cellspacing="1">')) return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
if (!PMA_exportOutputHandler('<table class="width100" cellspacing="1">')) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
// Gets the data from the database
|
// Gets the data from the database
|
||||||
$result = PMA_DBI_query($sql_query, NULL, PMA_DBI_QUERY_UNBUFFERED);
|
$result = PMA_DBI_query($sql_query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||||
$fields_cnt = PMA_DBI_num_fields($result);
|
$fields_cnt = PMA_DBI_num_fields($result);
|
||||||
|
|
||||||
// If required, get fields name at the first line
|
// If required, get fields name at the first line
|
||||||
@@ -118,7 +123,9 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
|||||||
$schema_insert .= '<td class="print"><b>' . htmlspecialchars(stripslashes(PMA_DBI_field_name($result, $i))) . '</b></td>';
|
$schema_insert .= '<td class="print"><b>' . htmlspecialchars(stripslashes(PMA_DBI_field_name($result, $i))) . '</b></td>';
|
||||||
} // end for
|
} // end for
|
||||||
$schema_insert .= '</tr>';
|
$schema_insert .= '</tr>';
|
||||||
if (!PMA_exportOutputHandler($schema_insert)) return FALSE;
|
if (!PMA_exportOutputHandler($schema_insert)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
} // end if
|
} // end if
|
||||||
|
|
||||||
// Format the data
|
// Format the data
|
||||||
@@ -135,10 +142,14 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
|||||||
$schema_insert .= '<td class="print">' . htmlspecialchars($value) . '</td>';
|
$schema_insert .= '<td class="print">' . htmlspecialchars($value) . '</td>';
|
||||||
} // end for
|
} // end for
|
||||||
$schema_insert .= '</tr>';
|
$schema_insert .= '</tr>';
|
||||||
if (!PMA_exportOutputHandler($schema_insert)) return FALSE;
|
if (!PMA_exportOutputHandler($schema_insert)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
} // end while
|
} // end while
|
||||||
PMA_DBI_free_result($result);
|
PMA_DBI_free_result($result);
|
||||||
if (!PMA_exportOutputHandler('</table>')) return FALSE;
|
if (!PMA_exportOutputHandler('</table>')) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -147,7 +158,9 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
|
|||||||
{
|
{
|
||||||
global $cfgRelation;
|
global $cfgRelation;
|
||||||
|
|
||||||
if (!PMA_exportOutputHandler('<h2>' . $GLOBALS['strTableStructure'] . ' ' .$table . '</h2>')) return FALSE;
|
if (!PMA_exportOutputHandler('<h2>' . $GLOBALS['strTableStructure'] . ' ' .$table . '</h2>')) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the unique keys in the table
|
* Get the unique keys in the table
|
||||||
@@ -156,7 +169,9 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
|
|||||||
$keys_result = PMA_DBI_query($keys_query);
|
$keys_result = PMA_DBI_query($keys_query);
|
||||||
$unique_keys = array();
|
$unique_keys = array();
|
||||||
while ($key = PMA_DBI_fetch_assoc($keys_result)) {
|
while ($key = PMA_DBI_fetch_assoc($keys_result)) {
|
||||||
if ($key['Non_unique'] == 0) $unique_keys[] = $key['Column_name'];
|
if ($key['Non_unique'] == 0) {
|
||||||
|
$unique_keys[] = $key['Column_name'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
PMA_DBI_free_result($keys_result);
|
PMA_DBI_free_result($keys_result);
|
||||||
|
|
||||||
@@ -179,15 +194,16 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
|
|||||||
} else {
|
} else {
|
||||||
$have_rel = FALSE;
|
$have_rel = FALSE;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$have_rel = FALSE;
|
$have_rel = FALSE;
|
||||||
} // end if
|
} // end if
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays the table structure
|
* Displays the table structure
|
||||||
*/
|
*/
|
||||||
if (!PMA_exportOutputHandler('<table class="width100" cellspacing="1">')) return FALSE;
|
if (!PMA_exportOutputHandler('<table class="width100" cellspacing="1">')) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
$columns_cnt = 4;
|
$columns_cnt = 4;
|
||||||
if ($do_relation && $have_rel) {
|
if ($do_relation && $have_rel) {
|
||||||
@@ -218,7 +234,9 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
|
|||||||
}
|
}
|
||||||
$schema_insert .= '</tr>';
|
$schema_insert .= '</tr>';
|
||||||
|
|
||||||
if (!PMA_exportOutputHandler($schema_insert)) return FALSE;
|
if (!PMA_exportOutputHandler($schema_insert)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
while ($row = PMA_DBI_fetch_assoc($result)) {
|
while ($row = PMA_DBI_fetch_assoc($result)) {
|
||||||
|
|
||||||
@@ -294,7 +312,9 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
|
|||||||
|
|
||||||
$schema_insert .= '</tr>';
|
$schema_insert .= '</tr>';
|
||||||
|
|
||||||
if (!PMA_exportOutputHandler($schema_insert)) return FALSE;
|
if (!PMA_exportOutputHandler($schema_insert)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
} // end while
|
} // end while
|
||||||
PMA_DBI_free_result($result);
|
PMA_DBI_free_result($result);
|
||||||
|
|
||||||
|
@@ -129,7 +129,7 @@ function PMA_exportDBCreate($db) {
|
|||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
||||||
$result = PMA_DBI_try_query($sql_query, NULL, PMA_DBI_QUERY_UNBUFFERED);
|
$result = PMA_DBI_try_query($sql_query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||||
|
|
||||||
$columns_cnt = PMA_DBI_num_fields($result);
|
$columns_cnt = PMA_DBI_num_fields($result);
|
||||||
for ($i = 0; $i < $columns_cnt; $i++) {
|
for ($i = 0; $i < $columns_cnt; $i++) {
|
||||||
@@ -150,7 +150,9 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
|||||||
$buffer .= ' \\caption{' . str_replace('__TABLE__', PMA_texEscape($table), $GLOBALS['latex_data_caption'])
|
$buffer .= ' \\caption{' . str_replace('__TABLE__', PMA_texEscape($table), $GLOBALS['latex_data_caption'])
|
||||||
. '} \\label{' . str_replace('__TABLE__', $table, $GLOBALS['latex_data_label']) . '} \\\\';
|
. '} \\label{' . str_replace('__TABLE__', $table, $GLOBALS['latex_data_label']) . '} \\\\';
|
||||||
}
|
}
|
||||||
if (!PMA_exportOutputHandler($buffer)) return FALSE;
|
if (!PMA_exportOutputHandler($buffer)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
// show column names
|
// show column names
|
||||||
if (isset($GLOBALS['latex_showcolumns'])) {
|
if (isset($GLOBALS['latex_showcolumns'])) {
|
||||||
@@ -160,13 +162,19 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$buffer = substr($buffer, 0, -2) . '\\\\ \\hline \hline ';
|
$buffer = substr($buffer, 0, -2) . '\\\\ \\hline \hline ';
|
||||||
if (!PMA_exportOutputHandler($buffer . ' \\endfirsthead ' . $crlf)) return FALSE;
|
if (!PMA_exportOutputHandler($buffer . ' \\endfirsthead ' . $crlf)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
if (isset($GLOBALS['latex_caption'])) {
|
if (isset($GLOBALS['latex_caption'])) {
|
||||||
if (!PMA_exportOutputHandler('\\caption{' . str_replace('__TABLE__', PMA_texEscape($table), $GLOBALS['latex_data_continued_caption']) . '} \\\\ ')) return FALSE;
|
if (!PMA_exportOutputHandler('\\caption{' . str_replace('__TABLE__', PMA_texEscape($table), $GLOBALS['latex_data_continued_caption']) . '} \\\\ ')) return FALSE;
|
||||||
}
|
}
|
||||||
if (!PMA_exportOutputHandler($buffer . '\\endhead \\endfoot' . $crlf)) return FALSE;
|
if (!PMA_exportOutputHandler($buffer . '\\endhead \\endfoot' . $crlf)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!PMA_exportOutputHandler('\\\\ \hline')) return FALSE;
|
if (!PMA_exportOutputHandler('\\\\ \hline')) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// print the whole table
|
// print the whole table
|
||||||
@@ -189,11 +197,15 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$buffer .= ' \\\\ \\hline ' . $crlf;
|
$buffer .= ' \\\\ \\hline ' . $crlf;
|
||||||
if (!PMA_exportOutputHandler($buffer)) return FALSE;
|
if (!PMA_exportOutputHandler($buffer)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$buffer = ' \\end{longtable}' . $crlf;
|
$buffer = ' \\end{longtable}' . $crlf;
|
||||||
if (!PMA_exportOutputHandler($buffer)) return FALSE;
|
if (!PMA_exportOutputHandler($buffer)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
PMA_DBI_free_result($result);
|
PMA_DBI_free_result($result);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -227,7 +239,9 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
|
|||||||
$keys_result = PMA_DBI_query($keys_query);
|
$keys_result = PMA_DBI_query($keys_query);
|
||||||
$unique_keys = array();
|
$unique_keys = array();
|
||||||
while ($key = PMA_DBI_fetch_assoc($keys_result)) {
|
while ($key = PMA_DBI_fetch_assoc($keys_result)) {
|
||||||
if ($key['Non_unique'] == 0) $unique_keys[] = $key['Column_name'];
|
if ($key['Non_unique'] == 0) {
|
||||||
|
$unique_keys[] = $key['Column_name'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
PMA_DBI_free_result($keys_result);
|
PMA_DBI_free_result($keys_result);
|
||||||
|
|
||||||
@@ -250,8 +264,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
|
|||||||
} else {
|
} else {
|
||||||
$have_rel = FALSE;
|
$have_rel = FALSE;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$have_rel = FALSE;
|
$have_rel = FALSE;
|
||||||
} // end if
|
} // end if
|
||||||
|
|
||||||
@@ -260,7 +273,9 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
|
|||||||
*/
|
*/
|
||||||
$buffer = $crlf . '%' . $crlf . '% ' . $GLOBALS['strStructure'] . ': ' . $table . $crlf . '%' . $crlf
|
$buffer = $crlf . '%' . $crlf . '% ' . $GLOBALS['strStructure'] . ': ' . $table . $crlf . '%' . $crlf
|
||||||
. ' \\begin{longtable}{';
|
. ' \\begin{longtable}{';
|
||||||
if (!PMA_exportOutputHandler($buffer)) return FALSE;
|
if (!PMA_exportOutputHandler($buffer)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
$columns_cnt = 4;
|
$columns_cnt = 4;
|
||||||
$alignment = '|l|c|c|c|';
|
$alignment = '|l|c|c|c|';
|
||||||
@@ -308,7 +323,9 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
|
|||||||
}
|
}
|
||||||
$buffer .= $header . ' \\\\ \\hline \\hline \\endhead \\endfoot ';
|
$buffer .= $header . ' \\\\ \\hline \\hline \\endhead \\endfoot ';
|
||||||
|
|
||||||
if (!PMA_exportOutputHandler($buffer)) return FALSE;
|
if (!PMA_exportOutputHandler($buffer)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
while ($row = PMA_DBI_fetch_assoc($result)) {
|
while ($row = PMA_DBI_fetch_assoc($result)) {
|
||||||
|
|
||||||
@@ -388,7 +405,9 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
|
|||||||
$buffer = str_replace("\000", ' & ', $local_buffer);
|
$buffer = str_replace("\000", ' & ', $local_buffer);
|
||||||
$buffer .= ' \\\\ \\hline ' . $crlf;
|
$buffer .= ' \\\\ \\hline ' . $crlf;
|
||||||
|
|
||||||
if (!PMA_exportOutputHandler($buffer)) return FALSE;
|
if (!PMA_exportOutputHandler($buffer)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
} // end while
|
} // end while
|
||||||
PMA_DBI_free_result($result);
|
PMA_DBI_free_result($result);
|
||||||
|
|
||||||
|
@@ -204,7 +204,7 @@ class PMA_PDF extends PMA_FPDF
|
|||||||
|
|
||||||
// Pass 1 for column widths
|
// Pass 1 for column widths
|
||||||
// TODO: force here a LIMIT to speed up pass 1 ?
|
// TODO: force here a LIMIT to speed up pass 1 ?
|
||||||
$this->results = PMA_DBI_query($query, NULL, PMA_DBI_QUERY_UNBUFFERED);
|
$this->results = PMA_DBI_query($query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||||
$this->numFields = PMA_DBI_num_fields($this->results);
|
$this->numFields = PMA_DBI_num_fields($this->results);
|
||||||
$this->fields = PMA_DBI_get_fields_meta($this->results);
|
$this->fields = PMA_DBI_get_fields_meta($this->results);
|
||||||
|
|
||||||
@@ -272,7 +272,7 @@ class PMA_PDF extends PMA_FPDF
|
|||||||
|
|
||||||
// Pass 2
|
// Pass 2
|
||||||
|
|
||||||
$this->results = PMA_DBI_query($query, NULL, PMA_DBI_QUERY_UNBUFFERED);
|
$this->results = PMA_DBI_query($query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||||
$this->Open();
|
$this->Open();
|
||||||
$this->setY($this->tMargin);
|
$this->setY($this->tMargin);
|
||||||
$this->AddPage();
|
$this->AddPage();
|
||||||
|
@@ -14,7 +14,7 @@ $GLOBALS['comment_marker'] = '-- ';
|
|||||||
* Avoids undefined variables, use NULL so isset() returns false
|
* Avoids undefined variables, use NULL so isset() returns false
|
||||||
*/
|
*/
|
||||||
if ( ! isset( $use_backquotes ) ) {
|
if ( ! isset( $use_backquotes ) ) {
|
||||||
$use_backquotes = NULL;
|
$use_backquotes = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -24,7 +24,8 @@ if ( ! isset( $use_backquotes ) ) {
|
|||||||
*
|
*
|
||||||
* @return bool Whether it suceeded
|
* @return bool Whether it suceeded
|
||||||
*/
|
*/
|
||||||
function PMA_exportComment($text) {
|
function PMA_exportComment($text)
|
||||||
|
{
|
||||||
return PMA_exportOutputHandler($GLOBALS['comment_marker'] . $text . $GLOBALS['crlf']);
|
return PMA_exportOutputHandler($GLOBALS['comment_marker'] . $text . $GLOBALS['crlf']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,7 +36,8 @@ function PMA_exportComment($text) {
|
|||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function PMA_exportFooter() {
|
function PMA_exportFooter()
|
||||||
|
{
|
||||||
global $crlf;
|
global $crlf;
|
||||||
|
|
||||||
$foot = '';
|
$foot = '';
|
||||||
@@ -58,7 +60,8 @@ function PMA_exportFooter() {
|
|||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function PMA_exportHeader() {
|
function PMA_exportHeader()
|
||||||
|
{
|
||||||
global $crlf;
|
global $crlf;
|
||||||
global $cfg;
|
global $cfg;
|
||||||
|
|
||||||
@@ -107,10 +110,13 @@ function PMA_exportHeader() {
|
|||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function PMA_exportDBCreate($db) {
|
function PMA_exportDBCreate($db)
|
||||||
|
{
|
||||||
global $crlf;
|
global $crlf;
|
||||||
if (isset($GLOBALS['drop_database'])) {
|
if (isset($GLOBALS['drop_database'])) {
|
||||||
if (!PMA_exportOutputHandler('DROP DATABASE ' . (isset($GLOBALS['use_backquotes']) ? PMA_backquote($db) : $db) . ';' . $crlf)) return FALSE;
|
if (!PMA_exportOutputHandler('DROP DATABASE ' . (isset($GLOBALS['use_backquotes']) ? PMA_backquote($db) : $db) . ';' . $crlf)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$create_query = 'CREATE DATABASE ' . (isset($GLOBALS['use_backquotes']) ? PMA_backquote($db) : $db);
|
$create_query = 'CREATE DATABASE ' . (isset($GLOBALS['use_backquotes']) ? PMA_backquote($db) : $db);
|
||||||
if (PMA_MYSQL_INT_VERSION >= 40101) {
|
if (PMA_MYSQL_INT_VERSION >= 40101) {
|
||||||
@@ -122,7 +128,9 @@ function PMA_exportDBCreate($db) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$create_query .= ';' . $crlf;
|
$create_query .= ';' . $crlf;
|
||||||
if (!PMA_exportOutputHandler($create_query)) return FALSE;
|
if (!PMA_exportOutputHandler($create_query)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
if (isset($GLOBALS['use_backquotes']) && PMA_MYSQL_INT_VERSION >= 40100 && isset($GLOBALS['sql_compat']) && $GLOBALS['sql_compat'] == 'NONE') {
|
if (isset($GLOBALS['use_backquotes']) && PMA_MYSQL_INT_VERSION >= 40100 && isset($GLOBALS['sql_compat']) && $GLOBALS['sql_compat'] == 'NONE') {
|
||||||
return PMA_exportOutputHandler('USE ' . PMA_backquote($db) . ';' . $crlf);
|
return PMA_exportOutputHandler('USE ' . PMA_backquote($db) . ';' . $crlf);
|
||||||
}
|
}
|
||||||
@@ -138,7 +146,8 @@ function PMA_exportDBCreate($db) {
|
|||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function PMA_exportDBHeader($db) {
|
function PMA_exportDBHeader($db)
|
||||||
|
{
|
||||||
global $crlf;
|
global $crlf;
|
||||||
$head = $GLOBALS['comment_marker'] . $crlf
|
$head = $GLOBALS['comment_marker'] . $crlf
|
||||||
. $GLOBALS['comment_marker'] . $GLOBALS['strDatabase'] . ': ' . (isset($GLOBALS['use_backquotes']) ? PMA_backquote($db) : '\'' . $db . '\''). $crlf
|
. $GLOBALS['comment_marker'] . $GLOBALS['strDatabase'] . ': ' . (isset($GLOBALS['use_backquotes']) ? PMA_backquote($db) : '\'' . $db . '\''). $crlf
|
||||||
@@ -155,7 +164,8 @@ function PMA_exportDBHeader($db) {
|
|||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function PMA_exportDBFooter($db) {
|
function PMA_exportDBFooter($db)
|
||||||
|
{
|
||||||
$result = TRUE;
|
$result = TRUE;
|
||||||
if (isset($GLOBALS['sql_constraints'])) {
|
if (isset($GLOBALS['sql_constraints'])) {
|
||||||
$result = PMA_exportOutputHandler($GLOBALS['sql_constraints']);
|
$result = PMA_exportOutputHandler($GLOBALS['sql_constraints']);
|
||||||
@@ -193,7 +203,7 @@ function PMA_getTableDef($db, $table, $crlf, $error_url, $show_dates = false)
|
|||||||
$new_crlf = $crlf;
|
$new_crlf = $crlf;
|
||||||
|
|
||||||
// need to use PMA_DBI_QUERY_STORE with PMA_DBI_num_rows() in mysqli
|
// need to use PMA_DBI_QUERY_STORE with PMA_DBI_num_rows() in mysqli
|
||||||
$result = PMA_DBI_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . PMA_sqlAddslashes($table) . '\'', NULL, PMA_DBI_QUERY_STORE);
|
$result = PMA_DBI_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db) . ' LIKE \'' . PMA_sqlAddslashes($table) . '\'', null, PMA_DBI_QUERY_STORE);
|
||||||
if ($result != FALSE) {
|
if ($result != FALSE) {
|
||||||
if (PMA_DBI_num_rows($result) > 0) {
|
if (PMA_DBI_num_rows($result) > 0) {
|
||||||
$tmpres = PMA_DBI_fetch_assoc($result);
|
$tmpres = PMA_DBI_fetch_assoc($result);
|
||||||
@@ -233,7 +243,7 @@ function PMA_getTableDef($db, $table, $crlf, $error_url, $show_dates = false)
|
|||||||
PMA_DBI_query('SET SQL_QUOTE_SHOW_CREATE = 0');
|
PMA_DBI_query('SET SQL_QUOTE_SHOW_CREATE = 0');
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = PMA_DBI_query('SHOW CREATE TABLE ' . PMA_backquote($db) . '.' . PMA_backquote($table), NULL, PMA_DBI_QUERY_UNBUFFERED);
|
$result = PMA_DBI_query('SHOW CREATE TABLE ' . PMA_backquote($db) . '.' . PMA_backquote($table), null, PMA_DBI_QUERY_UNBUFFERED);
|
||||||
if ($result != FALSE && ($row = PMA_DBI_fetch_row($result))) {
|
if ($result != FALSE && ($row = PMA_DBI_fetch_row($result))) {
|
||||||
$create_query = $row[1];
|
$create_query = $row[1];
|
||||||
unset($row);
|
unset($row);
|
||||||
@@ -261,7 +271,9 @@ function PMA_getTableDef($db, $table, $crlf, $error_url, $show_dates = false)
|
|||||||
|
|
||||||
// lets find first line with constraints
|
// lets find first line with constraints
|
||||||
for ($i = 0; $i < $sql_count; $i++) {
|
for ($i = 0; $i < $sql_count; $i++) {
|
||||||
if (preg_match('@^[\s]*(CONSTRAINT|FOREIGN[\s]+KEY)@', $sql_lines[$i])) break;
|
if (preg_match('@^[\s]*(CONSTRAINT|FOREIGN[\s]+KEY)@', $sql_lines[$i])) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we really found a constraint
|
// If we really found a constraint
|
||||||
@@ -362,13 +374,14 @@ function PMA_getTableComments($db, $table, $crlf, $do_relation = false, $do_comm
|
|||||||
} else {
|
} else {
|
||||||
$have_rel = FALSE;
|
$have_rel = FALSE;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$have_rel = FALSE;
|
$have_rel = FALSE;
|
||||||
} // end if
|
} // end if
|
||||||
|
|
||||||
if ($do_mime && $cfgRelation['mimework']) {
|
if ($do_mime && $cfgRelation['mimework']) {
|
||||||
if (!($mime_map = PMA_getMIME($db, $table, true))) unset($mime_map);
|
if (!($mime_map = PMA_getMIME($db, $table, true))) {
|
||||||
|
unset($mime_map);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($comments_map) && count($comments_map) > 0) {
|
if (isset($comments_map) && count($comments_map) > 0) {
|
||||||
@@ -422,7 +435,8 @@ function PMA_getTableComments($db, $table, $crlf, $do_relation = false, $do_comm
|
|||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function PMA_exportStructure($db, $table, $crlf, $error_url, $relation = FALSE, $comments = FALSE, $mime = FALSE, $dates = FALSE) {
|
function PMA_exportStructure($db, $table, $crlf, $error_url, $relation = FALSE, $comments = FALSE, $mime = FALSE, $dates = FALSE)
|
||||||
|
{
|
||||||
$formatted_table_name = (isset($GLOBALS['use_backquotes']))
|
$formatted_table_name = (isset($GLOBALS['use_backquotes']))
|
||||||
? PMA_backquote($table)
|
? PMA_backquote($table)
|
||||||
: '\'' . $table . '\'';
|
: '\'' . $table . '\'';
|
||||||
@@ -475,7 +489,9 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
|
|||||||
. $GLOBALS['comment_marker'] . $GLOBALS['strDumpingData'] . ' ' . $formatted_table_name . $crlf
|
. $GLOBALS['comment_marker'] . $GLOBALS['strDumpingData'] . ' ' . $formatted_table_name . $crlf
|
||||||
. $GLOBALS['comment_marker'] . $crlf .$crlf;
|
. $GLOBALS['comment_marker'] . $crlf .$crlf;
|
||||||
|
|
||||||
if (!PMA_exportOutputHandler($head)) return FALSE;
|
if (!PMA_exportOutputHandler($head)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
$buffer = '';
|
$buffer = '';
|
||||||
|
|
||||||
@@ -484,7 +500,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
|
|||||||
// are used, we did not get the true column name in case of aliases)
|
// are used, we did not get the true column name in case of aliases)
|
||||||
$analyzed_sql = PMA_SQP_analyze(PMA_SQP_parse($sql_query));
|
$analyzed_sql = PMA_SQP_analyze(PMA_SQP_parse($sql_query));
|
||||||
|
|
||||||
$result = PMA_DBI_query($sql_query, NULL, PMA_DBI_QUERY_UNBUFFERED);
|
$result = PMA_DBI_query($sql_query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||||
if ($result != FALSE) {
|
if ($result != FALSE) {
|
||||||
$fields_cnt = PMA_DBI_num_fields($result);
|
$fields_cnt = PMA_DBI_num_fields($result);
|
||||||
|
|
||||||
@@ -506,8 +522,9 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
|
|||||||
if (isset($GLOBALS['sql_type']) && $GLOBALS['sql_type'] == 'update') {
|
if (isset($GLOBALS['sql_type']) && $GLOBALS['sql_type'] == 'update') {
|
||||||
// update
|
// update
|
||||||
$schema_insert = 'UPDATE ';
|
$schema_insert = 'UPDATE ';
|
||||||
if (isset($GLOBALS['sql_ignore']))
|
if (isset($GLOBALS['sql_ignore'])) {
|
||||||
$schema_insert .= 'IGNORE ';
|
$schema_insert .= 'IGNORE ';
|
||||||
|
}
|
||||||
$schema_insert .= PMA_backquote($table, $use_backquotes) . ' SET ';
|
$schema_insert .= PMA_backquote($table, $use_backquotes) . ' SET ';
|
||||||
} else {
|
} else {
|
||||||
// insert or replace
|
// insert or replace
|
||||||
@@ -601,7 +618,9 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
|
|||||||
} else {
|
} else {
|
||||||
$insert_line = '(' . implode(', ', $values) . ')';
|
$insert_line = '(' . implode(', ', $values) . ')';
|
||||||
if (isset($GLOBALS['max_query_size']) && $GLOBALS['max_query_size'] > 0 && $query_size + strlen($insert_line) > $GLOBALS['max_query_size']) {
|
if (isset($GLOBALS['max_query_size']) && $GLOBALS['max_query_size'] > 0 && $query_size + strlen($insert_line) > $GLOBALS['max_query_size']) {
|
||||||
if (!PMA_exportOutputHandler(';' . $crlf)) return FALSE;
|
if (!PMA_exportOutputHandler(';' . $crlf)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
$query_size = 0;
|
$query_size = 0;
|
||||||
$current_row = 1;
|
$current_row = 1;
|
||||||
$insert_line = $schema_insert . $insert_line;
|
$insert_line = $schema_insert . $insert_line;
|
||||||
@@ -616,11 +635,15 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
|
|||||||
}
|
}
|
||||||
unset($values);
|
unset($values);
|
||||||
|
|
||||||
if (!PMA_exportOutputHandler(($current_row == 1 ? '' : $separator . $crlf) . $insert_line)) return FALSE;
|
if (!PMA_exportOutputHandler(($current_row == 1 ? '' : $separator . $crlf) . $insert_line)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
} // end while
|
} // end while
|
||||||
if ($current_row > 0) {
|
if ($current_row > 0) {
|
||||||
if (!PMA_exportOutputHandler(';' . $crlf)) return FALSE;
|
if (!PMA_exportOutputHandler(';' . $crlf)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} // end if ($result != FALSE)
|
} // end if ($result != FALSE)
|
||||||
PMA_DBI_free_result($result);
|
PMA_DBI_free_result($result);
|
||||||
|
@@ -15,7 +15,8 @@ require_once('Spreadsheet/Excel/Writer.php');
|
|||||||
*
|
*
|
||||||
* @return bool Whether it suceeded
|
* @return bool Whether it suceeded
|
||||||
*/
|
*/
|
||||||
function PMA_exportComment($text) {
|
function PMA_exportComment($text)
|
||||||
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,7 +27,8 @@ function PMA_exportComment($text) {
|
|||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function PMA_exportFooter() {
|
function PMA_exportFooter()
|
||||||
|
{
|
||||||
global $workbook;
|
global $workbook;
|
||||||
global $tmp_filename;
|
global $tmp_filename;
|
||||||
|
|
||||||
@@ -35,7 +37,9 @@ function PMA_exportFooter() {
|
|||||||
echo $res->getMessage();
|
echo $res->getMessage();
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (!PMA_exportOutputHandler(file_get_contents($tmp_filename))) return FALSE;
|
if (!PMA_exportOutputHandler(file_get_contents($tmp_filename))) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
unlink($tmp_filename);
|
unlink($tmp_filename);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -48,11 +52,14 @@ function PMA_exportFooter() {
|
|||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function PMA_exportHeader() {
|
function PMA_exportHeader()
|
||||||
|
{
|
||||||
global $workbook;
|
global $workbook;
|
||||||
global $tmp_filename;
|
global $tmp_filename;
|
||||||
|
|
||||||
if (empty($GLOBALS['cfg']['TempDir'])) return FALSE;
|
if (empty($GLOBALS['cfg']['TempDir'])) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
$tmp_filename = tempnam(realpath($GLOBALS['cfg']['TempDir']), 'pma_xls_');
|
$tmp_filename = tempnam(realpath($GLOBALS['cfg']['TempDir']), 'pma_xls_');
|
||||||
$workbook = new Spreadsheet_Excel_Writer($tmp_filename);
|
$workbook = new Spreadsheet_Excel_Writer($tmp_filename);
|
||||||
|
|
||||||
@@ -68,7 +75,8 @@ function PMA_exportHeader() {
|
|||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function PMA_exportDBHeader($db) {
|
function PMA_exportDBHeader($db)
|
||||||
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,7 +89,8 @@ function PMA_exportDBHeader($db) {
|
|||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function PMA_exportDBFooter($db) {
|
function PMA_exportDBFooter($db)
|
||||||
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,7 +103,8 @@ function PMA_exportDBFooter($db) {
|
|||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function PMA_exportDBCreate($db) {
|
function PMA_exportDBCreate($db)
|
||||||
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,7 +121,8 @@ function PMA_exportDBCreate($db) {
|
|||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
|
||||||
|
{
|
||||||
global $what;
|
global $what;
|
||||||
global $workbook;
|
global $workbook;
|
||||||
|
|
||||||
@@ -119,7 +130,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
|||||||
$workbook->setTempDir(realpath($GLOBALS['cfg']['TempDir']));
|
$workbook->setTempDir(realpath($GLOBALS['cfg']['TempDir']));
|
||||||
|
|
||||||
// Gets the data from the database
|
// Gets the data from the database
|
||||||
$result = PMA_DBI_query($sql_query, NULL, PMA_DBI_QUERY_UNBUFFERED);
|
$result = PMA_DBI_query($sql_query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||||
$fields_cnt = PMA_DBI_num_fields($result);
|
$fields_cnt = PMA_DBI_num_fields($result);
|
||||||
$col = 0;
|
$col = 0;
|
||||||
|
|
||||||
|
@@ -124,7 +124,7 @@ function PMA_exportDBCreate($db) {
|
|||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
||||||
$result = PMA_DBI_query($sql_query, NULL, PMA_DBI_QUERY_UNBUFFERED);
|
$result = PMA_DBI_query($sql_query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||||
|
|
||||||
$columns_cnt = PMA_DBI_num_fields($result);
|
$columns_cnt = PMA_DBI_num_fields($result);
|
||||||
for ($i = 0; $i < $columns_cnt; $i++) {
|
for ($i = 0; $i < $columns_cnt; $i++) {
|
||||||
@@ -133,7 +133,9 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
|||||||
unset($i);
|
unset($i);
|
||||||
|
|
||||||
$buffer = ' <!-- ' . $GLOBALS['strTable'] . ' ' . $table . ' -->' . $crlf;
|
$buffer = ' <!-- ' . $GLOBALS['strTable'] . ' ' . $table . ' -->' . $crlf;
|
||||||
if (!PMA_exportOutputHandler($buffer)) return FALSE;
|
if (!PMA_exportOutputHandler($buffer)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
while ($record = PMA_DBI_fetch_row($result)) {
|
while ($record = PMA_DBI_fetch_row($result)) {
|
||||||
$buffer = ' <' . $table . '>' . $crlf;
|
$buffer = ' <' . $table . '>' . $crlf;
|
||||||
@@ -145,7 +147,9 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
|
|||||||
}
|
}
|
||||||
$buffer .= ' </' . $table . '>' . $crlf;
|
$buffer .= ' </' . $table . '>' . $crlf;
|
||||||
|
|
||||||
if (!PMA_exportOutputHandler($buffer)) return FALSE;
|
if (!PMA_exportOutputHandler($buffer)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
PMA_DBI_free_result($result);
|
PMA_DBI_free_result($result);
|
||||||
|
|
||||||
|
@@ -10,7 +10,8 @@
|
|||||||
* @param string regullar expression to match files
|
* @param string regullar expression to match files
|
||||||
* @returns array sorted file list on success, FALSE on failure
|
* @returns array sorted file list on success, FALSE on failure
|
||||||
*/
|
*/
|
||||||
function PMA_getDirContent($dir, $expression = '') {
|
function PMA_getDirContent($dir, $expression = '')
|
||||||
|
{
|
||||||
if ($handle = @opendir($dir)) {
|
if ($handle = @opendir($dir)) {
|
||||||
$result = array();
|
$result = array();
|
||||||
if (substr($dir, -1) != '/') {
|
if (substr($dir, -1) != '/') {
|
||||||
@@ -37,9 +38,12 @@ function PMA_getDirContent($dir, $expression = '') {
|
|||||||
* @param string currently active choice
|
* @param string currently active choice
|
||||||
* @returns array sorted file list on success, FALSE on failure
|
* @returns array sorted file list on success, FALSE on failure
|
||||||
*/
|
*/
|
||||||
function PMA_getFileSelectOptions($dir, $extensions = '', $active = '') {
|
function PMA_getFileSelectOptions($dir, $extensions = '', $active = '')
|
||||||
|
{
|
||||||
$list = PMA_getDirContent($dir, $extensions);
|
$list = PMA_getDirContent($dir, $extensions);
|
||||||
if ($list === FALSE) return FALSE;
|
if ($list === FALSE) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
$result = '';
|
$result = '';
|
||||||
foreach ($list as $key => $val) {
|
foreach ($list as $key => $val) {
|
||||||
$result .= '<option value="'. htmlspecialchars($val) . '"';
|
$result .= '<option value="'. htmlspecialchars($val) . '"';
|
||||||
@@ -56,21 +60,28 @@ function PMA_getFileSelectOptions($dir, $extensions = '', $active = '') {
|
|||||||
*
|
*
|
||||||
* @returns string | separated list of extensions usable in PMA_getDirContent
|
* @returns string | separated list of extensions usable in PMA_getDirContent
|
||||||
*/
|
*/
|
||||||
function PMA_supportedDecompressions() {
|
function PMA_supportedDecompressions()
|
||||||
|
{
|
||||||
global $cfg;
|
global $cfg;
|
||||||
|
|
||||||
$compressions = '';
|
$compressions = '';
|
||||||
|
|
||||||
if ($cfg['GZipDump'] && @function_exists('gzopen')) {
|
if ($cfg['GZipDump'] && @function_exists('gzopen')) {
|
||||||
if (!empty($compressions)) $compressions .= '|';
|
if (!empty($compressions)) {
|
||||||
|
$compressions .= '|';
|
||||||
|
}
|
||||||
$compressions .= 'gz';
|
$compressions .= 'gz';
|
||||||
}
|
}
|
||||||
if ($cfg['BZipDump'] && @function_exists('bzopen')) {
|
if ($cfg['BZipDump'] && @function_exists('bzopen')) {
|
||||||
if (!empty($compressions)) $compressions .= '|';
|
if (!empty($compressions)) {
|
||||||
|
$compressions .= '|';
|
||||||
|
}
|
||||||
$compressions .= 'bz2';
|
$compressions .= 'bz2';
|
||||||
}
|
}
|
||||||
if ($cfg['ZipDump'] && @function_exists('gzinflate')) {
|
if ($cfg['ZipDump'] && @function_exists('gzinflate')) {
|
||||||
if (!empty($compressions)) $compressions .= '|';
|
if (!empty($compressions)) {
|
||||||
|
$compressions .= '|';
|
||||||
|
}
|
||||||
$compressions .= 'zip';
|
$compressions .= 'zip';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -68,13 +68,17 @@ require_once('./libraries/relation.lib.php'); // for PMA_setHistory()
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// Link to itself to replicate windows including frameset
|
// Link to itself to replicate windows including frameset
|
||||||
if (!isset($GLOBALS['checked_special'])) $GLOBALS['checked_special'] = FALSE;
|
if (!isset($GLOBALS['checked_special'])) {
|
||||||
|
$GLOBALS['checked_special'] = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($_SERVER['SCRIPT_NAME']) && empty($_POST) && !$GLOBALS['checked_special']) {
|
if (isset($_SERVER['SCRIPT_NAME']) && empty($_POST) && !$GLOBALS['checked_special']) {
|
||||||
echo '<div id="selflink">' . "\n";
|
echo '<div id="selflink">' . "\n";
|
||||||
echo '<a href="index.php?target=' . basename($_SERVER['SCRIPT_NAME']);
|
echo '<a href="index.php?target=' . basename($_SERVER['SCRIPT_NAME']);
|
||||||
$url = PMA_generate_common_url(isset($GLOBALS['db']) ? $GLOBALS['db'] : '', isset($GLOBALS['table']) ? $GLOBALS['table'] : '');
|
$url = PMA_generate_common_url(isset($GLOBALS['db']) ? $GLOBALS['db'] : '', isset($GLOBALS['table']) ? $GLOBALS['table'] : '');
|
||||||
if (!empty($url)) echo '&' . $url;
|
if (!empty($url)) {
|
||||||
|
echo '&' . $url;
|
||||||
|
}
|
||||||
echo '" target="_blank">' . $GLOBALS['strOpenNewWindow'] . '</a>' . "\n";
|
echo '" target="_blank">' . $GLOBALS['strOpenNewWindow'] . '</a>' . "\n";
|
||||||
echo '</div>' . "\n";
|
echo '</div>' . "\n";
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,30 +1,33 @@
|
|||||||
<?php
|
<?php
|
||||||
/*******************************************************************************
|
|
||||||
* Software: UFPDF, Unicode Free PDF generator *
|
|
||||||
* Version: 0.1 *
|
|
||||||
* based on FPDF 1.52 by Olivier PLATHEY *
|
|
||||||
* Date: 2004-09-01 *
|
|
||||||
* Author: Steven Wittens <steven@acko.net> *
|
|
||||||
* License: GPL *
|
|
||||||
* *
|
|
||||||
* UFPDF is a modification of FPDF to support Unicode through UTF-8. *
|
|
||||||
* *
|
|
||||||
*******************************************************************************/
|
|
||||||
|
|
||||||
if(!class_exists('UFPDF'))
|
/**
|
||||||
{
|
* Software: UFPDF, Unicode Free PDF generator *
|
||||||
|
*
|
||||||
|
* Version: 0.1 *
|
||||||
|
*
|
||||||
|
* based on FPDF 1.52 by Olivier PLATHEY *
|
||||||
|
*
|
||||||
|
* Date: 2004-09-01 *
|
||||||
|
*
|
||||||
|
* Author: Steven Wittens <steven@acko.net> *
|
||||||
|
*
|
||||||
|
* License: GPL *
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* UFPDF is a modification of FPDF to support Unicode through UTF-8. *
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!class_exists('UFPDF')) {
|
||||||
define('UFPDF_VERSION', '0.1');
|
define('UFPDF_VERSION', '0.1');
|
||||||
|
|
||||||
include_once './libraries/fpdf/fpdf.php';
|
include_once './libraries/fpdf/fpdf.php';
|
||||||
|
|
||||||
class UFPDF extends FPDF
|
class UFPDF extends FPDF {
|
||||||
{
|
/**
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* *
|
|
||||||
* Public methods *
|
* Public methods *
|
||||||
* *
|
*/
|
||||||
*******************************************************************************/
|
|
||||||
function UFPDF($orientation = 'P', $unit = 'mm', $format = 'A4')
|
function UFPDF($orientation = 'P', $unit = 'mm', $format = 'A4')
|
||||||
{
|
{
|
||||||
FPDF::FPDF($orientation, $unit, $format);
|
FPDF::FPDF($orientation, $unit, $format);
|
||||||
@@ -37,8 +40,11 @@ function GetStringWidth($s)
|
|||||||
$codepoints = $this->utf8_to_codepoints($s);
|
$codepoints = $this->utf8_to_codepoints($s);
|
||||||
$cw = &$this->CurrentFont['cw'];
|
$cw = &$this->CurrentFont['cw'];
|
||||||
$w = 0;
|
$w = 0;
|
||||||
foreach($codepoints as $cp)
|
|
||||||
|
foreach ($codepoints as $cp) {
|
||||||
$w += isset($cw[$cp])?$cw[$cp]:0;
|
$w += isset($cw[$cp])?$cw[$cp]:0;
|
||||||
|
}
|
||||||
|
|
||||||
return $w * $this->FontSize / 1000;
|
return $w * $this->FontSize / 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,39 +52,60 @@ function AddFont($family,$style='',$file='')
|
|||||||
{
|
{
|
||||||
// Add a TrueType or Type1 font
|
// Add a TrueType or Type1 font
|
||||||
$family = strtolower($family);
|
$family = strtolower($family);
|
||||||
if($family=='arial')
|
|
||||||
|
if ($family == 'arial') {
|
||||||
$family = 'helvetica';
|
$family = 'helvetica';
|
||||||
|
}
|
||||||
|
|
||||||
$style = strtoupper($style);
|
$style = strtoupper($style);
|
||||||
if($style=='IB')
|
|
||||||
|
if ($style == 'IB') {
|
||||||
$style = 'BI';
|
$style = 'BI';
|
||||||
if(isset($this->fonts[$family.$style]))
|
}
|
||||||
|
|
||||||
|
if (isset($this->fonts[$family . $style])) {
|
||||||
$this->Error('Font already added: ' . $family . ' ' . $style);
|
$this->Error('Font already added: ' . $family . ' ' . $style);
|
||||||
if($file=='')
|
}
|
||||||
|
|
||||||
|
if ($file == '') {
|
||||||
$file = str_replace(' ', '', $family) . strtolower($style) . '.php';
|
$file = str_replace(' ', '', $family) . strtolower($style) . '.php';
|
||||||
if(defined('FPDF_FONTPATH'))
|
}
|
||||||
|
|
||||||
|
if (defined('FPDF_FONTPATH')) {
|
||||||
$file = FPDF_FONTPATH . $file;
|
$file = FPDF_FONTPATH . $file;
|
||||||
|
}
|
||||||
|
|
||||||
include($file);
|
include($file);
|
||||||
if(!isset($name))
|
|
||||||
|
if (!isset($name)) {
|
||||||
$this->Error('Could not include font definition file');
|
$this->Error('Could not include font definition file');
|
||||||
|
}
|
||||||
|
|
||||||
$i = count($this->fonts) + 1;
|
$i = count($this->fonts) + 1;
|
||||||
$this->fonts[$family . $style] = array('i' => $i, 'type' => $type, 'name' => $name, 'desc' => $desc, 'up' => $up, 'ut' => $ut, 'cw' => $cw, 'file' => $file, 'ctg' => $ctg);
|
$this->fonts[$family . $style] = array('i' => $i, 'type' => $type, 'name' => $name, 'desc' => $desc, 'up' => $up, 'ut' => $ut, 'cw' => $cw, 'file' => $file, 'ctg' => $ctg);
|
||||||
if($file)
|
|
||||||
{
|
if ($file) {
|
||||||
if($type=='TrueTypeUnicode')
|
if ($type == 'TrueTypeUnicode') {
|
||||||
$this->FontFiles[$file] = array('length1' => $originalsize);
|
$this->FontFiles[$file] = array('length1' => $originalsize);
|
||||||
else
|
} else {
|
||||||
$this->FontFiles[$file] = array('length1' => $size1, 'length2' => $size2);
|
$this->FontFiles[$file] = array('length1' => $size1, 'length2' => $size2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function Text($x, $y, $txt)
|
function Text($x, $y, $txt)
|
||||||
{
|
{
|
||||||
// Output a string
|
// Output a string
|
||||||
$s = sprintf('BT %.2f %.2f Td %s Tj ET', $x * $this->k, ($this->h - $y) * $this->k, $this->_escapetext($txt));
|
$s = sprintf('BT %.2f %.2f Td %s Tj ET', $x * $this->k, ($this->h - $y) * $this->k, $this->_escapetext($txt));
|
||||||
if($this->underline and $txt!='')
|
|
||||||
|
if ($this->underline and $txt != '') {
|
||||||
$s .= ' ' . $this->_dounderline($x, $y, $this->GetStringWidth($txt), $txt);
|
$s .= ' ' . $this->_dounderline($x, $y, $this->GetStringWidth($txt), $txt);
|
||||||
if($this->ColorFlag)
|
}
|
||||||
|
|
||||||
|
if ($this->ColorFlag) {
|
||||||
$s = 'q ' . $this->TextColor . ' ' . $s . ' Q';
|
$s = 'q ' . $this->TextColor . ' ' . $s . ' Q';
|
||||||
|
}
|
||||||
|
|
||||||
$this->_out($s);
|
$this->_out($s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,89 +119,118 @@ function Cell($w,$h=0,$txt='',$border=0,$ln=0,$align='',$fill=0,$link='')
|
|||||||
{
|
{
|
||||||
// Output a cell
|
// Output a cell
|
||||||
$k = $this->k;
|
$k = $this->k;
|
||||||
if($this->y+$h>$this->PageBreakTrigger and !$this->InFooter and $this->AcceptPageBreak())
|
|
||||||
{
|
if ($this->y + $h > $this->PageBreakTrigger and !$this->InFooter and $this->AcceptPageBreak()) {
|
||||||
// Automatic page break
|
// Automatic page break
|
||||||
$x = $this->x;
|
$x = $this->x;
|
||||||
$ws = $this->ws;
|
$ws = $this->ws;
|
||||||
if($ws>0)
|
|
||||||
{
|
if ($ws > 0) {
|
||||||
$this->ws = 0;
|
$this->ws = 0;
|
||||||
$this->_out('0 Tw');
|
$this->_out('0 Tw');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->AddPage($this->CurOrientation);
|
$this->AddPage($this->CurOrientation);
|
||||||
$this->x = $x;
|
$this->x = $x;
|
||||||
if($ws>0)
|
|
||||||
{
|
if ($ws > 0) {
|
||||||
$this->ws = $ws;
|
$this->ws = $ws;
|
||||||
$this->_out(sprintf('%.3f Tw', $ws * $k));
|
$this->_out(sprintf('%.3f Tw', $ws * $k));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($w==0)
|
|
||||||
|
if ($w == 0) {
|
||||||
$w = $this->w - $this->rMargin - $this->x;
|
$w = $this->w - $this->rMargin - $this->x;
|
||||||
|
}
|
||||||
|
|
||||||
$s = '';
|
$s = '';
|
||||||
if($fill==1 or $border==1)
|
|
||||||
{
|
if ($fill == 1 or $border == 1) {
|
||||||
if($fill==1)
|
if ($fill == 1) {
|
||||||
$op = ($border == 1) ? 'B' : 'f';
|
$op = ($border == 1) ? 'B' : 'f';
|
||||||
else
|
} else {
|
||||||
$op = 'S';
|
$op = 'S';
|
||||||
|
}
|
||||||
|
|
||||||
$s = sprintf('%.2f %.2f %.2f %.2f re %s ', $this->x * $k, ($this->h - $this->y) * $k, $w * $k, - $h * $k, $op);
|
$s = sprintf('%.2f %.2f %.2f %.2f re %s ', $this->x * $k, ($this->h - $this->y) * $k, $w * $k, - $h * $k, $op);
|
||||||
}
|
}
|
||||||
if(is_string($border))
|
|
||||||
{
|
if (is_string($border)) {
|
||||||
$x = $this->x;
|
$x = $this->x;
|
||||||
$y = $this->y;
|
$y = $this->y;
|
||||||
if(is_int(strpos($border,'L')))
|
|
||||||
|
if (is_int(strpos($border, 'L'))) {
|
||||||
$s .= sprintf('%.2f %.2f m %.2f %.2f l S ', $x * $k, ($this->h - $y) * $k, $x * $k, ($this->h - ($y + $h)) * $k);
|
$s .= sprintf('%.2f %.2f m %.2f %.2f l S ', $x * $k, ($this->h - $y) * $k, $x * $k, ($this->h - ($y + $h)) * $k);
|
||||||
if(is_int(strpos($border,'T')))
|
}
|
||||||
|
|
||||||
|
if (is_int(strpos($border, 'T'))) {
|
||||||
$s .= sprintf('%.2f %.2f m %.2f %.2f l S ', $x * $k, ($this->h - $y) * $k, ($x + $w) * $k, ($this->h - $y) * $k);
|
$s .= sprintf('%.2f %.2f m %.2f %.2f l S ', $x * $k, ($this->h - $y) * $k, ($x + $w) * $k, ($this->h - $y) * $k);
|
||||||
if(is_int(strpos($border,'R')))
|
}
|
||||||
|
|
||||||
|
if (is_int(strpos($border, 'R'))) {
|
||||||
$s .= sprintf('%.2f %.2f m %.2f %.2f l S ', ($x + $w) * $k, ($this->h - $y) * $k, ($x + $w) * $k, ($this->h - ($y + $h)) * $k);
|
$s .= sprintf('%.2f %.2f m %.2f %.2f l S ', ($x + $w) * $k, ($this->h - $y) * $k, ($x + $w) * $k, ($this->h - ($y + $h)) * $k);
|
||||||
if(is_int(strpos($border,'B')))
|
}
|
||||||
|
|
||||||
|
if (is_int(strpos($border, 'B'))) {
|
||||||
$s .= sprintf('%.2f %.2f m %.2f %.2f l S ', $x * $k, ($this->h - ($y + $h)) * $k, ($x + $w) * $k, ($this->h - ($y + $h)) * $k);
|
$s .= sprintf('%.2f %.2f m %.2f %.2f l S ', $x * $k, ($this->h - ($y + $h)) * $k, ($x + $w) * $k, ($this->h - ($y + $h)) * $k);
|
||||||
}
|
}
|
||||||
if($txt!='')
|
}
|
||||||
{
|
|
||||||
|
if ($txt != '') {
|
||||||
$width = $this->GetStringWidth($txt);
|
$width = $this->GetStringWidth($txt);
|
||||||
if($align=='R')
|
|
||||||
|
if ($align == 'R') {
|
||||||
$dx = $w - $this->cMargin - $width;
|
$dx = $w - $this->cMargin - $width;
|
||||||
elseif($align=='C')
|
} elseif ($align == 'C') {
|
||||||
$dx = ($w - $width) / 2;
|
$dx = ($w - $width) / 2;
|
||||||
else
|
} else {
|
||||||
$dx = $this->cMargin;
|
$dx = $this->cMargin;
|
||||||
if($this->ColorFlag)
|
}
|
||||||
|
|
||||||
|
if ($this->ColorFlag) {
|
||||||
$s .= 'q ' . $this->TextColor . ' ';
|
$s .= 'q ' . $this->TextColor . ' ';
|
||||||
|
}
|
||||||
|
|
||||||
$txtstring = $this->_escapetext($txt);
|
$txtstring = $this->_escapetext($txt);
|
||||||
$s .= sprintf('BT %.2f %.2f Td %s Tj ET', ($this->x + $dx) * $k, ($this->h - ($this->y + .5 * $h + .3 * $this->FontSize)) * $k, $txtstring);
|
$s .= sprintf('BT %.2f %.2f Td %s Tj ET', ($this->x + $dx) * $k, ($this->h - ($this->y + .5 * $h + .3 * $this->FontSize)) * $k, $txtstring);
|
||||||
if($this->underline)
|
|
||||||
|
if ($this->underline) {
|
||||||
$s .= ' ' . $this->_dounderline($this->x + $dx, $this->y + .5 * $h + .3 * $this->FontSize, $width, $txt);
|
$s .= ' ' . $this->_dounderline($this->x + $dx, $this->y + .5 * $h + .3 * $this->FontSize, $width, $txt);
|
||||||
if($this->ColorFlag)
|
}
|
||||||
|
|
||||||
|
if ($this->ColorFlag) {
|
||||||
$s .= ' Q';
|
$s .= ' Q';
|
||||||
if($link)
|
}
|
||||||
|
|
||||||
|
if ($link) {
|
||||||
$this->Link($this->x + $dx, $this->y + .5 * $h - .5 * $this->FontSize, $width, $this->FontSize, $link);
|
$this->Link($this->x + $dx, $this->y + .5 * $h - .5 * $this->FontSize, $width, $this->FontSize, $link);
|
||||||
}
|
}
|
||||||
if($s)
|
}
|
||||||
|
|
||||||
|
if ($s) {
|
||||||
$this->_out($s);
|
$this->_out($s);
|
||||||
|
}
|
||||||
|
|
||||||
$this->lasth = $h;
|
$this->lasth = $h;
|
||||||
if($ln>0)
|
|
||||||
{
|
if ($ln > 0) {
|
||||||
// Go to next line
|
// Go to next line
|
||||||
$this->y += $h;
|
$this->y += $h;
|
||||||
if($ln==1)
|
|
||||||
|
if ($ln == 1) {
|
||||||
$this->x = $this->lMargin;
|
$this->x = $this->lMargin;
|
||||||
}
|
}
|
||||||
else
|
} else {
|
||||||
$this->x += $w;
|
$this->x += $w;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/**
|
||||||
* *
|
|
||||||
* Protected methods *
|
* Protected methods *
|
||||||
* *
|
*/
|
||||||
*******************************************************************************/
|
|
||||||
|
|
||||||
function _puttruetypeunicode($font) {
|
function _puttruetypeunicode($font)
|
||||||
|
{
|
||||||
// Type0 Font
|
// Type0 Font
|
||||||
$this->_newobj();
|
$this->_newobj();
|
||||||
$this->_out('<</Type /Font');
|
$this->_out('<</Type /Font');
|
||||||
@@ -184,7 +240,6 @@ function _puttruetypeunicode($font) {
|
|||||||
$this->_out('/DescendantFonts [' . ($this->n + 1) . ' 0 R]');
|
$this->_out('/DescendantFonts [' . ($this->n + 1) . ' 0 R]');
|
||||||
$this->_out('>>');
|
$this->_out('>>');
|
||||||
$this->_out('endobj');
|
$this->_out('endobj');
|
||||||
|
|
||||||
// CIDFont
|
// CIDFont
|
||||||
$this->_newobj();
|
$this->_newobj();
|
||||||
$this->_out('<</Type /Font');
|
$this->_out('<</Type /Font');
|
||||||
@@ -194,41 +249,53 @@ function _puttruetypeunicode($font) {
|
|||||||
$this->_out('/FontDescriptor ' . ($this->n + 1) . ' 0 R');
|
$this->_out('/FontDescriptor ' . ($this->n + 1) . ' 0 R');
|
||||||
$c = 0;
|
$c = 0;
|
||||||
$widths = '';
|
$widths = '';
|
||||||
|
|
||||||
foreach ($font['cw'] as $i => $w) {
|
foreach ($font['cw'] as $i => $w) {
|
||||||
$widths .= $i . ' [' . $w . '] ';
|
$widths .= $i . ' [' . $w . '] ';
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_out('/W [' . $widths . ']');
|
$this->_out('/W [' . $widths . ']');
|
||||||
$this->_out('/CIDToGIDMap ' . ($this->n + 2) . ' 0 R');
|
$this->_out('/CIDToGIDMap ' . ($this->n + 2) . ' 0 R');
|
||||||
$this->_out('>>');
|
$this->_out('>>');
|
||||||
$this->_out('endobj');
|
$this->_out('endobj');
|
||||||
|
|
||||||
// Font descriptor
|
// Font descriptor
|
||||||
$this->_newobj();
|
$this->_newobj();
|
||||||
$this->_out('<</Type /FontDescriptor');
|
$this->_out('<</Type /FontDescriptor');
|
||||||
$this->_out('/FontName /' . $font['name']);
|
$this->_out('/FontName /' . $font['name']);
|
||||||
$s = '';
|
$s = '';
|
||||||
|
|
||||||
foreach ($font['desc'] as $k => $v) {
|
foreach ($font['desc'] as $k => $v) {
|
||||||
$s .= ' /' . $k . ' ' . $v;
|
$s .= ' /' . $k . ' ' . $v;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($font['file']) {
|
if ($font['file']) {
|
||||||
$s .= ' /FontFile2 ' . $this->FontFiles[$font['file']]['n'] . ' 0 R';
|
$s .= ' /FontFile2 ' . $this->FontFiles[$font['file']]['n'] . ' 0 R';
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_out($s);
|
$this->_out($s);
|
||||||
$this->_out('>>');
|
$this->_out('>>');
|
||||||
$this->_out('endobj');
|
$this->_out('endobj');
|
||||||
|
|
||||||
// Embed CIDToGIDMap
|
// Embed CIDToGIDMap
|
||||||
$this->_newobj();
|
$this->_newobj();
|
||||||
if(defined('FPDF_FONTPATH'))
|
|
||||||
|
if (defined('FPDF_FONTPATH')) {
|
||||||
$file = FPDF_FONTPATH . $font['ctg'];
|
$file = FPDF_FONTPATH . $font['ctg'];
|
||||||
else
|
} else {
|
||||||
$file = $font['ctg'];
|
$file = $font['ctg'];
|
||||||
|
}
|
||||||
|
|
||||||
$size = filesize($file);
|
$size = filesize($file);
|
||||||
if(!$size)
|
|
||||||
|
if (!$size) {
|
||||||
$this->Error('Font file not found');
|
$this->Error('Font file not found');
|
||||||
|
}
|
||||||
|
|
||||||
$this->_out('<</Length ' . $size);
|
$this->_out('<</Length ' . $size);
|
||||||
if(substr($file,-2) == '.z')
|
|
||||||
|
if (substr($file, -2) == '.z') {
|
||||||
$this->_out('/Filter /FlateDecode');
|
$this->_out('/Filter /FlateDecode');
|
||||||
|
}
|
||||||
|
|
||||||
$this->_out('>>');
|
$this->_out('>>');
|
||||||
$f = fopen($file, 'rb');
|
$f = fopen($file, 'rb');
|
||||||
$this->_putstream(fread($f, $size));
|
$this->_putstream(fread($f, $size));
|
||||||
@@ -253,7 +320,8 @@ function _textstring($s)
|
|||||||
return '(' . strtr($s, array(')' => '\\)', '(' => '\\(', '\\' => '\\\\')) . ')';
|
return '(' . strtr($s, array(')' => '\\)', '(' => '\\(', '\\' => '\\\\')) . ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
function _strreplace($what, $to, $where) {
|
function _strreplace($what, $to, $where)
|
||||||
|
{
|
||||||
$to = '' . $to;
|
$to = '' . $to;
|
||||||
return str_replace($this->utf8_to_utf16be($what, false), $this->utf8_to_utf16be($to, false), $where);
|
return str_replace($this->utf8_to_utf16be($what, false), $this->utf8_to_utf16be($to, false), $where);
|
||||||
}
|
}
|
||||||
@@ -269,24 +337,36 @@ function _escapetext($s)
|
|||||||
function _putinfo()
|
function _putinfo()
|
||||||
{
|
{
|
||||||
$this->_out('/Producer ' . $this->_textstring('UFPDF ' . UFPDF_VERSION));
|
$this->_out('/Producer ' . $this->_textstring('UFPDF ' . UFPDF_VERSION));
|
||||||
if(!empty($this->title))
|
|
||||||
|
if (!empty($this->title)) {
|
||||||
$this->_out('/Title ' . $this->_textstring($this->title));
|
$this->_out('/Title ' . $this->_textstring($this->title));
|
||||||
if(!empty($this->subject))
|
|
||||||
$this->_out('/Subject '.$this->_textstring($this->subject));
|
|
||||||
if(!empty($this->author))
|
|
||||||
$this->_out('/Author '.$this->_textstring($this->author));
|
|
||||||
if(!empty($this->keywords))
|
|
||||||
$this->_out('/Keywords '.$this->_textstring($this->keywords));
|
|
||||||
if(!empty($this->creator))
|
|
||||||
$this->_out('/Creator '.$this->_textstring($this->creator));
|
|
||||||
$this->_out('/CreationDate '.$this->_textstring('D:'.date('YmdHis')));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($this->subject)) {
|
||||||
|
$this->_out('/Subject ' . $this->_textstring($this->subject));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($this->author)) {
|
||||||
|
$this->_out('/Author ' . $this->_textstring($this->author));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($this->keywords)) {
|
||||||
|
$this->_out('/Keywords ' . $this->_textstring($this->keywords));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($this->creator)) {
|
||||||
|
$this->_out('/Creator ' . $this->_textstring($this->creator));
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->_out('/CreationDate ' . $this->_textstring('D:' . date('YmdHis')));
|
||||||
|
}
|
||||||
// UTF-8 to UTF-16BE conversion.
|
// UTF-8 to UTF-16BE conversion.
|
||||||
// Correctly handles all illegal UTF-8 sequences.
|
// Correctly handles all illegal UTF-8 sequences.
|
||||||
function utf8_to_utf16be(&$txt, $bom = true) {
|
function utf8_to_utf16be(&$txt, $bom = true)
|
||||||
|
{
|
||||||
$l = strlen($txt);
|
$l = strlen($txt);
|
||||||
$out = $bom ? "\xFE\xFF" : '';
|
$out = $bom ? "\xFE\xFF" : '';
|
||||||
|
|
||||||
for ($i = 0; $i < $l; ++$i) {
|
for ($i = 0; $i < $l; ++$i) {
|
||||||
$c = ord($txt{$i});
|
$c = ord($txt{$i});
|
||||||
// ASCII
|
// ASCII
|
||||||
@@ -296,51 +376,61 @@ function utf8_to_utf16be(&$txt, $bom = true) {
|
|||||||
// Lost continuation byte
|
// Lost continuation byte
|
||||||
elseif ($c < 0xC0) {
|
elseif ($c < 0xC0) {
|
||||||
$out .= "\xFF\xFD";
|
$out .= "\xFF\xFD";
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Multibyte sequence leading byte
|
// Multibyte sequence leading byte
|
||||||
else {
|
else {
|
||||||
if ($c < 0xE0) {
|
if ($c < 0xE0) {
|
||||||
$s = 2;
|
$s = 2;
|
||||||
}
|
} elseif ($c < 0xF0) {
|
||||||
else if ($c < 0xF0) {
|
|
||||||
$s = 3;
|
$s = 3;
|
||||||
}
|
} elseif ($c < 0xF8) {
|
||||||
else if ($c < 0xF8) {
|
|
||||||
$s = 4;
|
$s = 4;
|
||||||
}
|
}
|
||||||
// 5/6 byte sequences not possible for Unicode.
|
// 5/6 byte sequences not possible for Unicode.
|
||||||
else {
|
else {
|
||||||
$out .= "\xFF\xFD";
|
$out .= "\xFF\xFD";
|
||||||
while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; }
|
|
||||||
|
while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) {
|
||||||
|
++$i;
|
||||||
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$q = array($c);
|
$q = array($c);
|
||||||
// Fetch rest of sequence
|
// Fetch rest of sequence
|
||||||
$l = strlen($txt);
|
$l = strlen($txt);
|
||||||
while ($i + 1 < $l && ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; $q[] = ord($txt{$i}); }
|
|
||||||
|
|
||||||
|
while ($i + 1 < $l && ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) {
|
||||||
|
++$i;
|
||||||
|
$q[] = ord($txt{$i});
|
||||||
|
}
|
||||||
// Check length
|
// Check length
|
||||||
if (count($q) != $s) {
|
if (count($q) != $s) {
|
||||||
$out .= "\xFF\xFD";
|
$out .= "\xFF\xFD";
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($s) {
|
switch ($s) {
|
||||||
case 2:
|
case 2:
|
||||||
|
|
||||||
$cp = (($q[0] ^ 0xC0) << 6) | ($q[1] ^ 0x80);
|
$cp = (($q[0] ^ 0xC0) << 6) | ($q[1] ^ 0x80);
|
||||||
// Overlong sequence
|
// Overlong sequence
|
||||||
if ($cp < 0x80) {
|
if ($cp < 0x80) {
|
||||||
$out .= "\xFF\xFD";
|
$out .= "\xFF\xFD";
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$out .= chr($cp >> 8);
|
$out .= chr($cp >> 8);
|
||||||
|
|
||||||
$out .= chr($cp &0xFF);
|
$out .= chr($cp &0xFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
|
|
||||||
$cp = (($q[0] ^ 0xE0) << 12) | (($q[1] ^ 0x80) << 6) | ($q[2] ^ 0x80);
|
$cp = (($q[0] ^ 0xE0) << 12) | (($q[1] ^ 0x80) << 6) | ($q[2] ^ 0x80);
|
||||||
// Overlong sequence
|
// Overlong sequence
|
||||||
if ($cp < 0x800) {
|
if ($cp < 0x800) {
|
||||||
@@ -349,14 +439,16 @@ function utf8_to_utf16be(&$txt, $bom = true) {
|
|||||||
// Check for UTF-8 encoded surrogates (caused by a bad UTF-8 encoder)
|
// Check for UTF-8 encoded surrogates (caused by a bad UTF-8 encoder)
|
||||||
elseif ($c > 0xD800 && $c < 0xDFFF) {
|
elseif ($c > 0xD800 && $c < 0xDFFF) {
|
||||||
$out .= "\xFF\xFD";
|
$out .= "\xFF\xFD";
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$out .= chr($cp >> 8);
|
$out .= chr($cp >> 8);
|
||||||
|
|
||||||
$out .= chr($cp &0xFF);
|
$out .= chr($cp &0xFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
|
|
||||||
$cp = (($q[0] ^ 0xF0) << 18) | (($q[1] ^ 0x80) << 12) | (($q[2] ^ 0x80) << 6) | ($q[3] ^ 0x80);
|
$cp = (($q[0] ^ 0xF0) << 18) | (($q[1] ^ 0x80) << 12) | (($q[2] ^ 0x80) << 6) | ($q[3] ^ 0x80);
|
||||||
// Overlong sequence
|
// Overlong sequence
|
||||||
if ($cp < 0x10000) {
|
if ($cp < 0x10000) {
|
||||||
@@ -365,30 +457,37 @@ function utf8_to_utf16be(&$txt, $bom = true) {
|
|||||||
// Outside of the Unicode range
|
// Outside of the Unicode range
|
||||||
elseif ($cp >= 0x10FFFF) {
|
elseif ($cp >= 0x10FFFF) {
|
||||||
$out .= "\xFF\xFD";
|
$out .= "\xFF\xFD";
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Use surrogates
|
// Use surrogates
|
||||||
$cp -= 0x10000;
|
$cp -= 0x10000;
|
||||||
|
|
||||||
$s1 = 0xD800 | ($cp >> 10);
|
$s1 = 0xD800 | ($cp >> 10);
|
||||||
|
|
||||||
$s2 = 0xDC00 | ($cp &0x3FF);
|
$s2 = 0xDC00 | ($cp &0x3FF);
|
||||||
|
|
||||||
$out .= chr($s1 >> 8);
|
$out .= chr($s1 >> 8);
|
||||||
|
|
||||||
$out .= chr($s1 &0xFF);
|
$out .= chr($s1 &0xFF);
|
||||||
|
|
||||||
$out .= chr($s2 >> 8);
|
$out .= chr($s2 >> 8);
|
||||||
|
|
||||||
$out .= chr($s2 &0xFF);
|
$out .= chr($s2 &0xFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
// UTF-8 to codepoint array conversion.
|
// UTF-8 to codepoint array conversion.
|
||||||
// Correctly handles all illegal UTF-8 sequences.
|
// Correctly handles all illegal UTF-8 sequences.
|
||||||
function utf8_to_codepoints(&$txt) {
|
function utf8_to_codepoints(&$txt)
|
||||||
|
{
|
||||||
$l = strlen($txt);
|
$l = strlen($txt);
|
||||||
$out = array();
|
$out = array();
|
||||||
|
|
||||||
for ($i = 0; $i < $l; ++$i) {
|
for ($i = 0; $i < $l; ++$i) {
|
||||||
$c = ord($txt{$i});
|
$c = ord($txt{$i});
|
||||||
// ASCII
|
// ASCII
|
||||||
@@ -398,50 +497,59 @@ function utf8_to_codepoints(&$txt) {
|
|||||||
// Lost continuation byte
|
// Lost continuation byte
|
||||||
elseif ($c < 0xC0) {
|
elseif ($c < 0xC0) {
|
||||||
$out[] = 0xFFFD;
|
$out[] = 0xFFFD;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Multibyte sequence leading byte
|
// Multibyte sequence leading byte
|
||||||
else {
|
else {
|
||||||
if ($c < 0xE0) {
|
if ($c < 0xE0) {
|
||||||
$s = 2;
|
$s = 2;
|
||||||
}
|
} elseif ($c < 0xF0) {
|
||||||
else if ($c < 0xF0) {
|
|
||||||
$s = 3;
|
$s = 3;
|
||||||
}
|
} elseif ($c < 0xF8) {
|
||||||
else if ($c < 0xF8) {
|
|
||||||
$s = 4;
|
$s = 4;
|
||||||
}
|
}
|
||||||
// 5/6 byte sequences not possible for Unicode.
|
// 5/6 byte sequences not possible for Unicode.
|
||||||
else {
|
else {
|
||||||
$out[] = 0xFFFD;
|
$out[] = 0xFFFD;
|
||||||
while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; }
|
|
||||||
|
while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) {
|
||||||
|
++$i;
|
||||||
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$q = array($c);
|
$q = array($c);
|
||||||
// Fetch rest of sequence
|
// Fetch rest of sequence
|
||||||
$l = strlen($txt);
|
$l = strlen($txt);
|
||||||
while ($i + 1 < $l && ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; $q[] = ord($txt{$i}); }
|
|
||||||
|
|
||||||
|
while ($i + 1 < $l && ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) {
|
||||||
|
++$i;
|
||||||
|
$q[] = ord($txt{$i});
|
||||||
|
}
|
||||||
// Check length
|
// Check length
|
||||||
if (count($q) != $s) {
|
if (count($q) != $s) {
|
||||||
$out[] = 0xFFFD;
|
$out[] = 0xFFFD;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($s) {
|
switch ($s) {
|
||||||
case 2:
|
case 2:
|
||||||
|
|
||||||
$cp = (($q[0] ^ 0xC0) << 6) | ($q[1] ^ 0x80);
|
$cp = (($q[0] ^ 0xC0) << 6) | ($q[1] ^ 0x80);
|
||||||
// Overlong sequence
|
// Overlong sequence
|
||||||
if ($cp < 0x80) {
|
if ($cp < 0x80) {
|
||||||
$out[] = 0xFFFD;
|
$out[] = 0xFFFD;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$out[] = $cp;
|
$out[] = $cp;
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
|
|
||||||
$cp = (($q[0] ^ 0xE0) << 12) | (($q[1] ^ 0x80) << 6) | ($q[2] ^ 0x80);
|
$cp = (($q[0] ^ 0xE0) << 12) | (($q[1] ^ 0x80) << 6) | ($q[2] ^ 0x80);
|
||||||
// Overlong sequence
|
// Overlong sequence
|
||||||
if ($cp < 0x800) {
|
if ($cp < 0x800) {
|
||||||
@@ -450,13 +558,14 @@ function utf8_to_codepoints(&$txt) {
|
|||||||
// Check for UTF-8 encoded surrogates (caused by a bad UTF-8 encoder)
|
// Check for UTF-8 encoded surrogates (caused by a bad UTF-8 encoder)
|
||||||
elseif ($c > 0xD800 && $c < 0xDFFF) {
|
elseif ($c > 0xD800 && $c < 0xDFFF) {
|
||||||
$out[] = 0xFFFD;
|
$out[] = 0xFFFD;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$out[] = $cp;
|
$out[] = $cp;
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
|
|
||||||
$cp = (($q[0] ^ 0xF0) << 18) | (($q[1] ^ 0x80) << 12) | (($q[2] ^ 0x80) << 6) | ($q[3] ^ 0x80);
|
$cp = (($q[0] ^ 0xF0) << 18) | (($q[1] ^ 0x80) << 12) | (($q[2] ^ 0x80) << 6) | ($q[3] ^ 0x80);
|
||||||
// Overlong sequence
|
// Overlong sequence
|
||||||
if ($cp < 0x10000) {
|
if ($cp < 0x10000) {
|
||||||
@@ -465,19 +574,19 @@ function utf8_to_codepoints(&$txt) {
|
|||||||
// Outside of the Unicode range
|
// Outside of the Unicode range
|
||||||
elseif ($cp >= 0x10FFFF) {
|
elseif ($cp >= 0x10FFFF) {
|
||||||
$out[] = 0xFFFD;
|
$out[] = 0xFFFD;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$out[] = $cp;
|
$out[] = $cp;
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of class
|
// End of class
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@@ -64,8 +64,7 @@ if ($foreigners && isset($foreigners[$field])) {
|
|||||||
}
|
}
|
||||||
@PMA_DBI_free_result($disp);
|
@PMA_DBI_free_result($disp);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
unset($disp_row);
|
unset($disp_row);
|
||||||
$foreign_link = true;
|
$foreign_link = true;
|
||||||
}
|
}
|
||||||
|
@@ -28,10 +28,11 @@ echo "<?xml version=\"1.0\" encoding=\"" . $GLOBALS['charset'] . "\"?".">";
|
|||||||
<link rel="icon" href="./favicon.ico" type="image/x-icon" />
|
<link rel="icon" href="./favicon.ico" type="image/x-icon" />
|
||||||
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
|
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
|
||||||
<title><?php
|
<title><?php
|
||||||
if(!empty($page_title))
|
if (!empty($page_title)) {
|
||||||
echo htmlspecialchars($page_title);
|
echo htmlspecialchars($page_title);
|
||||||
else
|
} else {
|
||||||
echo 'phpMyAdmin';
|
echo 'phpMyAdmin';
|
||||||
|
}
|
||||||
?></title>
|
?></title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
|
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
|
||||||
<link rel="stylesheet" type="text/css" href="<?php echo defined('PMA_PATH_TO_BASEDIR') ? PMA_PATH_TO_BASEDIR : './'; ?>css/phpmyadmin.css.php?<?php echo PMA_generate_common_url(); ?>&js_frame=<?php echo isset($print_view) ? 'print' : 'right'; ?>" />
|
<link rel="stylesheet" type="text/css" href="<?php echo defined('PMA_PATH_TO_BASEDIR') ? PMA_PATH_TO_BASEDIR : './'; ?>css/phpmyadmin.css.php?<?php echo PMA_generate_common_url(); ?>&js_frame=<?php echo isset($print_view) ? 'print' : 'right'; ?>" />
|
||||||
|
@@ -15,7 +15,8 @@ define('PMA_CHK_DROP', 1);
|
|||||||
* @return boolean true if timeout is close
|
* @return boolean true if timeout is close
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function PMA_checkTimeout() {
|
function PMA_checkTimeout()
|
||||||
|
{
|
||||||
global $timestamp, $maximum_time, $timeout_passed;
|
global $timestamp, $maximum_time, $timeout_passed;
|
||||||
if ($maximum_time == 0) {
|
if ($maximum_time == 0) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -37,16 +38,23 @@ function PMA_checkTimeout() {
|
|||||||
* @return string MIME type of compression, none for none
|
* @return string MIME type of compression, none for none
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function PMA_detectCompression($filepath) {
|
function PMA_detectCompression($filepath)
|
||||||
|
{
|
||||||
$file = @fopen($filepath, 'rb');
|
$file = @fopen($filepath, 'rb');
|
||||||
if (!$file) {
|
if (!$file) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
$test = fread($file, 4);
|
$test = fread($file, 4);
|
||||||
fclose($file);
|
fclose($file);
|
||||||
if ($test[0] == chr(31) && $test[1] == chr(139)) return 'application/gzip';
|
if ($test[0] == chr(31) && $test[1] == chr(139)) {
|
||||||
if (substr($test, 0, 3) == 'BZh') return 'application/bzip2';
|
return 'application/gzip';
|
||||||
if ($test == "PK\003\004") return 'application/zip';
|
}
|
||||||
|
if (substr($test, 0, 3) == 'BZh') {
|
||||||
|
return 'application/bzip2';
|
||||||
|
}
|
||||||
|
if ($test == "PK\003\004") {
|
||||||
|
return 'application/zip';
|
||||||
|
}
|
||||||
return 'none';
|
return 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +66,8 @@ function PMA_detectCompression($filepath) {
|
|||||||
* @param string query to display, this might be commented
|
* @param string query to display, this might be commented
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function PMA_importRunQuery($sql = '', $full = '') {
|
function PMA_importRunQuery($sql = '', $full = '')
|
||||||
|
{
|
||||||
global $import_run_buffer, $go_sql, $complete_query, $display_query, $sql_query, $cfg, $my_die, $error, $reload, $finished, $timeout_passed, $skip_queries, $executed_queries, $max_sql_len, $read_multiply, $cfg, $sql_query_disabled, $db, $run_query, $is_superuser;
|
global $import_run_buffer, $go_sql, $complete_query, $display_query, $sql_query, $cfg, $my_die, $error, $reload, $finished, $timeout_passed, $skip_queries, $executed_queries, $max_sql_len, $read_multiply, $cfg, $sql_query_disabled, $db, $run_query, $is_superuser;
|
||||||
$read_multiply = 1;
|
$read_multiply = 1;
|
||||||
if (isset($import_run_buffer)) {
|
if (isset($import_run_buffer)) {
|
||||||
@@ -181,19 +190,29 @@ function PMA_importRunQuery($sql = '', $full = '') {
|
|||||||
* @return string part of file/buffer
|
* @return string part of file/buffer
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function PMA_importGetNextChunk($size = 32768) {
|
function PMA_importGetNextChunk($size = 32768)
|
||||||
|
{
|
||||||
global $import_file, $import_text, $finished, $compression, $import_handle, $offset, $charset_conversion, $charset_of_file, $charset, $read_multiply, $read_limit;
|
global $import_file, $import_text, $finished, $compression, $import_handle, $offset, $charset_conversion, $charset_of_file, $charset, $read_multiply, $read_limit;
|
||||||
|
|
||||||
// Add some progression while reading large amount of data
|
// Add some progression while reading large amount of data
|
||||||
if ($read_multiply <= 8) $size *= $read_multiply;
|
if ($read_multiply <= 8) {
|
||||||
else $size *= 8;
|
$size *= $read_multiply;
|
||||||
|
} else {
|
||||||
|
$size *= 8;
|
||||||
|
}
|
||||||
$read_multiply++;
|
$read_multiply++;
|
||||||
|
|
||||||
// We can not read too much
|
// We can not read too much
|
||||||
if ($size > $read_limit) $size = $read_limit;
|
if ($size > $read_limit) {
|
||||||
|
$size = $read_limit;
|
||||||
|
}
|
||||||
|
|
||||||
if (PMA_checkTimeout()) return FALSE;
|
if (PMA_checkTimeout()) {
|
||||||
if ($finished) return TRUE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
if ($finished) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if ($import_file == 'none') {
|
if ($import_file == 'none') {
|
||||||
// Well this is not yet supported and tested, but should return content of textarea
|
// Well this is not yet supported and tested, but should return content of textarea
|
||||||
|
@@ -118,7 +118,9 @@ if ($plugin_param == 'table') {
|
|||||||
$buffer .= $data;
|
$buffer .= $data;
|
||||||
// Do not parse string when we're not at the end and don't have new line inside
|
// Do not parse string when we're not at the end and don't have new line inside
|
||||||
if (($csv_new_line == 'auto' && strpos($buffer, "\r") === FALSE && strpos($buffer, "\n") === FALSE)
|
if (($csv_new_line == 'auto' && strpos($buffer, "\r") === FALSE && strpos($buffer, "\n") === FALSE)
|
||||||
|| ($csv_new_line != 'auto' && strpos($buffer, $csv_new_line) === FALSE)) continue;
|
|| ($csv_new_line != 'auto' && strpos($buffer, $csv_new_line) === FALSE)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Current length of our buffer
|
// Current length of our buffer
|
||||||
@@ -140,7 +142,9 @@ if ($plugin_param == 'table') {
|
|||||||
// Grab empty field
|
// Grab empty field
|
||||||
if ($ch == $csv_terminated) {
|
if ($ch == $csv_terminated) {
|
||||||
$values[] = '';
|
$values[] = '';
|
||||||
if ($i == $len - 1) break;
|
if ($i == $len - 1) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
$i++;
|
$i++;
|
||||||
$ch = $buffer[$i];
|
$ch = $buffer[$i];
|
||||||
continue;
|
continue;
|
||||||
@@ -149,7 +153,9 @@ if ($plugin_param == 'table') {
|
|||||||
// Grab one field
|
// Grab one field
|
||||||
if ($ch == $csv_enclosed) {
|
if ($ch == $csv_enclosed) {
|
||||||
$need_end = TRUE;
|
$need_end = TRUE;
|
||||||
if ($i == $len - 1) break;
|
if ($i == $len - 1) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
$i++;
|
$i++;
|
||||||
$ch = $buffer[$i];
|
$ch = $buffer[$i];
|
||||||
} else {
|
} else {
|
||||||
@@ -176,11 +182,15 @@ if ($plugin_param == 'table') {
|
|||||||
$i++;
|
$i++;
|
||||||
$ch = $buffer[$i];
|
$ch = $buffer[$i];
|
||||||
}
|
}
|
||||||
if ($fail) break;
|
if ($fail) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
$values[] = $value;
|
$values[] = $value;
|
||||||
// Need to strip trailing enclosing char?
|
// Need to strip trailing enclosing char?
|
||||||
if ($need_end && $ch == $csv_enclosed) {
|
if ($need_end && $ch == $csv_enclosed) {
|
||||||
if ($i == $len - 1) break;
|
if ($i == $len - 1) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
$i++;
|
$i++;
|
||||||
$ch = $buffer[$i];
|
$ch = $buffer[$i];
|
||||||
}
|
}
|
||||||
@@ -190,7 +200,9 @@ if ($plugin_param == 'table') {
|
|||||||
}
|
}
|
||||||
// Go to next char
|
// Go to next char
|
||||||
if ($ch == $csv_terminated) {
|
if ($ch == $csv_terminated) {
|
||||||
if ($i == $len - 1) break;
|
if ($i == $len - 1) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
$i++;
|
$i++;
|
||||||
$ch = $buffer[$i];
|
$ch = $buffer[$i];
|
||||||
}
|
}
|
||||||
@@ -199,7 +211,9 @@ if ($plugin_param == 'table') {
|
|||||||
// End of line
|
// End of line
|
||||||
if ($csv_finish || $ch == $csv_new_line || ($csv_new_line == 'auto' && ($ch == "\r" || $ch == "\n"))) {
|
if ($csv_finish || $ch == $csv_new_line || ($csv_new_line == 'auto' && ($ch == "\r" || $ch == "\n"))) {
|
||||||
if ($csv_new_line == 'auto' && $ch == "\r") { // Handle "\r\n"
|
if ($csv_new_line == 'auto' && $ch == "\r") { // Handle "\r\n"
|
||||||
if ($i >= ($len - 2) && !$finished) break; // We need more data to decide new line
|
if ($i >= ($len - 2) && !$finished) {
|
||||||
|
break; // We need more data to decide new line
|
||||||
|
}
|
||||||
if ($buffer[$i + 1] == "\n") {
|
if ($buffer[$i + 1] == "\n") {
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
@@ -29,7 +29,9 @@ if (isset($plugin_list)) {
|
|||||||
// Append new data to buffer
|
// Append new data to buffer
|
||||||
$buffer .= $data;
|
$buffer .= $data;
|
||||||
// Do not parse string when we're not at the end and don't have ; inside
|
// Do not parse string when we're not at the end and don't have ; inside
|
||||||
if ((strpos($buffer, ';') === FALSE) && !$finished) continue;
|
if ((strpos($buffer, ';') === FALSE) && !$finished) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Current length of our buffer
|
// Current length of our buffer
|
||||||
$len = strlen($buffer);
|
$len = strlen($buffer);
|
||||||
@@ -40,23 +42,39 @@ if (isset($plugin_list)) {
|
|||||||
//if ($i == $len) break;
|
//if ($i == $len) break;
|
||||||
$oi = $i;
|
$oi = $i;
|
||||||
$p1 = strpos($buffer, '\'', $i);
|
$p1 = strpos($buffer, '\'', $i);
|
||||||
if ($p1 === FALSE) $p1 = 2147483647;
|
if ($p1 === FALSE) {
|
||||||
|
$p1 = 2147483647;
|
||||||
|
}
|
||||||
$p2 = strpos($buffer, '"', $i);
|
$p2 = strpos($buffer, '"', $i);
|
||||||
if ($p2 === FALSE) $p2 = 2147483647;
|
if ($p2 === FALSE) {
|
||||||
|
$p2 = 2147483647;
|
||||||
|
}
|
||||||
$p3 = strpos($buffer, ';', $i);
|
$p3 = strpos($buffer, ';', $i);
|
||||||
if ($p3 === FALSE) $p3 = 2147483647;
|
if ($p3 === FALSE) {
|
||||||
|
$p3 = 2147483647;
|
||||||
|
}
|
||||||
$p4 = strpos($buffer, '#', $i);
|
$p4 = strpos($buffer, '#', $i);
|
||||||
if ($p4 === FALSE) $p4 = 2147483647;
|
if ($p4 === FALSE) {
|
||||||
|
$p4 = 2147483647;
|
||||||
|
}
|
||||||
$p5 = strpos($buffer, '--', $i);
|
$p5 = strpos($buffer, '--', $i);
|
||||||
if ($p5 === FALSE) $p5 = 2147483647;
|
if ($p5 === FALSE) {
|
||||||
|
$p5 = 2147483647;
|
||||||
|
}
|
||||||
$p6 = strpos($buffer, '/*', $i);
|
$p6 = strpos($buffer, '/*', $i);
|
||||||
if ($p6 === FALSE) $p6 = 2147483647;
|
if ($p6 === FALSE) {
|
||||||
|
$p6 = 2147483647;
|
||||||
|
}
|
||||||
$p7 = strpos($buffer, '`', $i);
|
$p7 = strpos($buffer, '`', $i);
|
||||||
if ($p7 === FALSE) $p7 = 2147483647;
|
if ($p7 === FALSE) {
|
||||||
|
$p7 = 2147483647;
|
||||||
|
}
|
||||||
$i = min ($p1, $p2, $p3, $p4, $p5, $p6, $p7);
|
$i = min ($p1, $p2, $p3, $p4, $p5, $p6, $p7);
|
||||||
if ($i == 2147483647) {
|
if ($i == 2147483647) {
|
||||||
$i = $oi;
|
$i = $oi;
|
||||||
if (!$finished) break;
|
if (!$finished) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
// at the end there might be some whitespace...
|
// at the end there might be some whitespace...
|
||||||
if (trim($buffer) == '') {
|
if (trim($buffer) == '') {
|
||||||
$buffer = '';
|
$buffer = '';
|
||||||
@@ -94,7 +112,9 @@ if (isset($plugin_list)) {
|
|||||||
// Skip the string
|
// Skip the string
|
||||||
$i = $pos;
|
$i = $pos;
|
||||||
}
|
}
|
||||||
if (!$endq) break;
|
if (!$endq) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
$i++;
|
$i++;
|
||||||
// Aren't we at the end?
|
// Aren't we at the end?
|
||||||
if ($finished && $i == $len) {
|
if ($finished && $i == $len) {
|
||||||
@@ -131,7 +151,9 @@ if (isset($plugin_list)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Skip *
|
// Skip *
|
||||||
if ($ch == '/') $i++;
|
if ($ch == '/') {
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
// Skip last char
|
// Skip last char
|
||||||
$i++;
|
$i++;
|
||||||
// Next query part will start here
|
// Next query part will start here
|
||||||
@@ -161,7 +183,9 @@ if (isset($plugin_list)) {
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
$start_pos = 0;
|
$start_pos = 0;
|
||||||
// Any chance we will get a complete query?
|
// Any chance we will get a complete query?
|
||||||
if ((strpos($buffer, ';') === FALSE) && !$finished) break;
|
if ((strpos($buffer, ';') === FALSE) && !$finished) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$i++;
|
$i++;
|
||||||
$start_pos = $i;
|
$start_pos = $i;
|
||||||
|
@@ -25,88 +25,72 @@ function PMA_getIp()
|
|||||||
if (empty($REMOTE_ADDR)) {
|
if (empty($REMOTE_ADDR)) {
|
||||||
if (!empty($_SERVER) && isset($_SERVER['REMOTE_ADDR'])) {
|
if (!empty($_SERVER) && isset($_SERVER['REMOTE_ADDR'])) {
|
||||||
$REMOTE_ADDR = $_SERVER['REMOTE_ADDR'];
|
$REMOTE_ADDR = $_SERVER['REMOTE_ADDR'];
|
||||||
}
|
} elseif (!empty($_ENV) && isset($_ENV['REMOTE_ADDR'])) {
|
||||||
else if (!empty($_ENV) && isset($_ENV['REMOTE_ADDR'])) {
|
|
||||||
$REMOTE_ADDR = $_ENV['REMOTE_ADDR'];
|
$REMOTE_ADDR = $_ENV['REMOTE_ADDR'];
|
||||||
}
|
} elseif (@getenv('REMOTE_ADDR')) {
|
||||||
else if (@getenv('REMOTE_ADDR')) {
|
|
||||||
$REMOTE_ADDR = getenv('REMOTE_ADDR');
|
$REMOTE_ADDR = getenv('REMOTE_ADDR');
|
||||||
}
|
}
|
||||||
} // end if
|
} // end if
|
||||||
if (empty($HTTP_X_FORWARDED_FOR)) {
|
if (empty($HTTP_X_FORWARDED_FOR)) {
|
||||||
if (!empty($_SERVER) && isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
if (!empty($_SERVER) && isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||||
$HTTP_X_FORWARDED_FOR = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
$HTTP_X_FORWARDED_FOR = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||||
}
|
} elseif (!empty($_ENV) && isset($_ENV['HTTP_X_FORWARDED_FOR'])) {
|
||||||
else if (!empty($_ENV) && isset($_ENV['HTTP_X_FORWARDED_FOR'])) {
|
|
||||||
$HTTP_X_FORWARDED_FOR = $_ENV['HTTP_X_FORWARDED_FOR'];
|
$HTTP_X_FORWARDED_FOR = $_ENV['HTTP_X_FORWARDED_FOR'];
|
||||||
}
|
} elseif (@getenv('HTTP_X_FORWARDED_FOR')) {
|
||||||
else if (@getenv('HTTP_X_FORWARDED_FOR')) {
|
|
||||||
$HTTP_X_FORWARDED_FOR = getenv('HTTP_X_FORWARDED_FOR');
|
$HTTP_X_FORWARDED_FOR = getenv('HTTP_X_FORWARDED_FOR');
|
||||||
}
|
}
|
||||||
} // end if
|
} // end if
|
||||||
if (empty($HTTP_X_FORWARDED)) {
|
if (empty($HTTP_X_FORWARDED)) {
|
||||||
if (!empty($_SERVER) && isset($_SERVER['HTTP_X_FORWARDED'])) {
|
if (!empty($_SERVER) && isset($_SERVER['HTTP_X_FORWARDED'])) {
|
||||||
$HTTP_X_FORWARDED = $_SERVER['HTTP_X_FORWARDED'];
|
$HTTP_X_FORWARDED = $_SERVER['HTTP_X_FORWARDED'];
|
||||||
}
|
} elseif (!empty($_ENV) && isset($_ENV['HTTP_X_FORWARDED'])) {
|
||||||
else if (!empty($_ENV) && isset($_ENV['HTTP_X_FORWARDED'])) {
|
|
||||||
$HTTP_X_FORWARDED = $_ENV['HTTP_X_FORWARDED'];
|
$HTTP_X_FORWARDED = $_ENV['HTTP_X_FORWARDED'];
|
||||||
}
|
} elseif (@getenv('HTTP_X_FORWARDED')) {
|
||||||
else if (@getenv('HTTP_X_FORWARDED')) {
|
|
||||||
$HTTP_X_FORWARDED = getenv('HTTP_X_FORWARDED');
|
$HTTP_X_FORWARDED = getenv('HTTP_X_FORWARDED');
|
||||||
}
|
}
|
||||||
} // end if
|
} // end if
|
||||||
if (empty($HTTP_FORWARDED_FOR)) {
|
if (empty($HTTP_FORWARDED_FOR)) {
|
||||||
if (!empty($_SERVER) && isset($_SERVER['HTTP_FORWARDED_FOR'])) {
|
if (!empty($_SERVER) && isset($_SERVER['HTTP_FORWARDED_FOR'])) {
|
||||||
$HTTP_FORWARDED_FOR = $_SERVER['HTTP_FORWARDED_FOR'];
|
$HTTP_FORWARDED_FOR = $_SERVER['HTTP_FORWARDED_FOR'];
|
||||||
}
|
} elseif (!empty($_ENV) && isset($_ENV['HTTP_FORWARDED_FOR'])) {
|
||||||
else if (!empty($_ENV) && isset($_ENV['HTTP_FORWARDED_FOR'])) {
|
|
||||||
$HTTP_FORWARDED_FOR = $_ENV['HTTP_FORWARDED_FOR'];
|
$HTTP_FORWARDED_FOR = $_ENV['HTTP_FORWARDED_FOR'];
|
||||||
}
|
} elseif (@getenv('HTTP_FORWARDED_FOR')) {
|
||||||
else if (@getenv('HTTP_FORWARDED_FOR')) {
|
|
||||||
$HTTP_FORWARDED_FOR = getenv('HTTP_FORWARDED_FOR');
|
$HTTP_FORWARDED_FOR = getenv('HTTP_FORWARDED_FOR');
|
||||||
}
|
}
|
||||||
} // end if
|
} // end if
|
||||||
if (empty($HTTP_FORWARDED)) {
|
if (empty($HTTP_FORWARDED)) {
|
||||||
if (!empty($_SERVER) && isset($_SERVER['HTTP_FORWARDED'])) {
|
if (!empty($_SERVER) && isset($_SERVER['HTTP_FORWARDED'])) {
|
||||||
$HTTP_FORWARDED = $_SERVER['HTTP_FORWARDED'];
|
$HTTP_FORWARDED = $_SERVER['HTTP_FORWARDED'];
|
||||||
}
|
} elseif (!empty($_ENV) && isset($_ENV['HTTP_FORWARDED'])) {
|
||||||
else if (!empty($_ENV) && isset($_ENV['HTTP_FORWARDED'])) {
|
|
||||||
$HTTP_FORWARDED = $_ENV['HTTP_FORWARDED'];
|
$HTTP_FORWARDED = $_ENV['HTTP_FORWARDED'];
|
||||||
}
|
} elseif (@getenv('HTTP_FORWARDED')) {
|
||||||
else if (@getenv('HTTP_FORWARDED')) {
|
|
||||||
$HTTP_FORWARDED = getenv('HTTP_FORWARDED');
|
$HTTP_FORWARDED = getenv('HTTP_FORWARDED');
|
||||||
}
|
}
|
||||||
} // end if
|
} // end if
|
||||||
if (empty($HTTP_VIA)) {
|
if (empty($HTTP_VIA)) {
|
||||||
if (!empty($_SERVER) && isset($_SERVER['HTTP_VIA'])) {
|
if (!empty($_SERVER) && isset($_SERVER['HTTP_VIA'])) {
|
||||||
$HTTP_VIA = $_SERVER['HTTP_VIA'];
|
$HTTP_VIA = $_SERVER['HTTP_VIA'];
|
||||||
}
|
} elseif (!empty($_ENV) && isset($_ENV['HTTP_VIA'])) {
|
||||||
else if (!empty($_ENV) && isset($_ENV['HTTP_VIA'])) {
|
|
||||||
$HTTP_VIA = $_ENV['HTTP_VIA'];
|
$HTTP_VIA = $_ENV['HTTP_VIA'];
|
||||||
}
|
} elseif (@getenv('HTTP_VIA')) {
|
||||||
else if (@getenv('HTTP_VIA')) {
|
|
||||||
$HTTP_VIA = getenv('HTTP_VIA');
|
$HTTP_VIA = getenv('HTTP_VIA');
|
||||||
}
|
}
|
||||||
} // end if
|
} // end if
|
||||||
if (empty($HTTP_X_COMING_FROM)) {
|
if (empty($HTTP_X_COMING_FROM)) {
|
||||||
if (!empty($_SERVER) && isset($_SERVER['HTTP_X_COMING_FROM'])) {
|
if (!empty($_SERVER) && isset($_SERVER['HTTP_X_COMING_FROM'])) {
|
||||||
$HTTP_X_COMING_FROM = $_SERVER['HTTP_X_COMING_FROM'];
|
$HTTP_X_COMING_FROM = $_SERVER['HTTP_X_COMING_FROM'];
|
||||||
}
|
} elseif (!empty($_ENV) && isset($_ENV['HTTP_X_COMING_FROM'])) {
|
||||||
else if (!empty($_ENV) && isset($_ENV['HTTP_X_COMING_FROM'])) {
|
|
||||||
$HTTP_X_COMING_FROM = $_ENV['HTTP_X_COMING_FROM'];
|
$HTTP_X_COMING_FROM = $_ENV['HTTP_X_COMING_FROM'];
|
||||||
}
|
} elseif (@getenv('HTTP_X_COMING_FROM')) {
|
||||||
else if (@getenv('HTTP_X_COMING_FROM')) {
|
|
||||||
$HTTP_X_COMING_FROM = getenv('HTTP_X_COMING_FROM');
|
$HTTP_X_COMING_FROM = getenv('HTTP_X_COMING_FROM');
|
||||||
}
|
}
|
||||||
} // end if
|
} // end if
|
||||||
if (empty($HTTP_COMING_FROM)) {
|
if (empty($HTTP_COMING_FROM)) {
|
||||||
if (!empty($_SERVER) && isset($_SERVER['HTTP_COMING_FROM'])) {
|
if (!empty($_SERVER) && isset($_SERVER['HTTP_COMING_FROM'])) {
|
||||||
$HTTP_COMING_FROM = $_SERVER['HTTP_COMING_FROM'];
|
$HTTP_COMING_FROM = $_SERVER['HTTP_COMING_FROM'];
|
||||||
}
|
} elseif (!empty($_ENV) && isset($_ENV['HTTP_COMING_FROM'])) {
|
||||||
else if (!empty($_ENV) && isset($_ENV['HTTP_COMING_FROM'])) {
|
|
||||||
$HTTP_COMING_FROM = $_ENV['HTTP_COMING_FROM'];
|
$HTTP_COMING_FROM = $_ENV['HTTP_COMING_FROM'];
|
||||||
}
|
} elseif (@getenv('HTTP_COMING_FROM')) {
|
||||||
else if (@getenv('HTTP_COMING_FROM')) {
|
|
||||||
$HTTP_COMING_FROM = getenv('HTTP_COMING_FROM');
|
$HTTP_COMING_FROM = getenv('HTTP_COMING_FROM');
|
||||||
}
|
}
|
||||||
} // end if
|
} // end if
|
||||||
|
@@ -50,7 +50,7 @@ if (PMA_MYSQL_INT_VERSION >= 40100){
|
|||||||
define('PMA_CSDROPDOWN_COLLATION', 0);
|
define('PMA_CSDROPDOWN_COLLATION', 0);
|
||||||
define('PMA_CSDROPDOWN_CHARSET', 1);
|
define('PMA_CSDROPDOWN_CHARSET', 1);
|
||||||
|
|
||||||
function PMA_generateCharsetDropdownBox($type = PMA_CSDROPDOWN_COLLATION, $name = NULL, $id = NULL, $default = NULL, $label = TRUE, $indent = 0, $submitOnChange = FALSE, $displayUnavailable = FALSE) {
|
function PMA_generateCharsetDropdownBox($type = PMA_CSDROPDOWN_COLLATION, $name = null, $id = null, $default = null, $label = TRUE, $indent = 0, $submitOnChange = FALSE, $displayUnavailable = FALSE) {
|
||||||
global $mysql_charsets, $mysql_charsets_descriptions, $mysql_charsets_available, $mysql_collations, $mysql_collations_available;
|
global $mysql_charsets, $mysql_charsets_descriptions, $mysql_charsets_available, $mysql_collations, $mysql_collations_available;
|
||||||
|
|
||||||
if (empty($name)) {
|
if (empty($name)) {
|
||||||
|
@@ -80,7 +80,9 @@ function PMA_splitSqlFile(&$ret, $sql, $release)
|
|||||||
if ($i === FALSE) {
|
if ($i === FALSE) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ($char == '/') $i++;
|
if ($char == '/') {
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// We are not in a string, first check for delimiter...
|
// We are not in a string, first check for delimiter...
|
||||||
@@ -151,8 +153,12 @@ function PMA_readFile($path, $mime = '') {
|
|||||||
}
|
}
|
||||||
$test = fread($file, 3);
|
$test = fread($file, 3);
|
||||||
fclose($file);
|
fclose($file);
|
||||||
if ($test[0] == chr(31) && $test[1] == chr(139)) return PMA_readFile($path, 'application/x-gzip');
|
if ($test[0] == chr(31) && $test[1] == chr(139)) {
|
||||||
if ($test == 'BZh') return PMA_readFile($path, 'application/x-bzip');
|
return PMA_readFile($path, 'application/x-gzip');
|
||||||
|
}
|
||||||
|
if ($test == 'BZh') {
|
||||||
|
return PMA_readFile($path, 'application/x-bzip');
|
||||||
|
}
|
||||||
return PMA_readFile($path, 'text/plain');
|
return PMA_readFile($path, 'text/plain');
|
||||||
case 'text/plain':
|
case 'text/plain':
|
||||||
$file = @fopen($path, 'rb');
|
$file = @fopen($path, 'rb');
|
||||||
|
@@ -583,7 +583,7 @@ function PMA_setComment($db, $table, $col, $comment, $removekey = '', $mode='aut
|
|||||||
if ($mode == 'native' && isset($table) && strlen($table)) {
|
if ($mode == 'native' && isset($table) && strlen($table)) {
|
||||||
$query = 'ALTER TABLE ' . PMA_backquote($table) . ' CHANGE '
|
$query = 'ALTER TABLE ' . PMA_backquote($table) . ' CHANGE '
|
||||||
. PMA_generateAlterTable($col, $col, '', '', '', '', FALSE, '', FALSE, '', $comment, '', '');
|
. PMA_generateAlterTable($col, $col, '', '', '', '', FALSE, '', FALSE, '', $comment, '', '');
|
||||||
PMA_DBI_try_query($query, NULL, PMA_DBI_QUERY_STORE);
|
PMA_DBI_try_query($query, null, PMA_DBI_QUERY_STORE);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -884,13 +884,13 @@ function PMA_foreignDropdown($disp, $foreign_field, $foreign_display, $data, $ma
|
|||||||
$bot = $reloptions[$cfg['ForeignKeyDropdownOrder'][1]];
|
$bot = $reloptions[$cfg['ForeignKeyDropdownOrder'][1]];
|
||||||
} elseif ($c == 1) {
|
} elseif ($c == 1) {
|
||||||
$bot = $reloptions[$cfg['ForeignKeyDropdownOrder'][0]];
|
$bot = $reloptions[$cfg['ForeignKeyDropdownOrder'][0]];
|
||||||
$top = NULL;
|
$top = null;
|
||||||
} else {
|
} else {
|
||||||
$top = $reloptions['id-content'];
|
$top = $reloptions['id-content'];
|
||||||
$bot = $reloptions['content-id'];
|
$bot = $reloptions['content-id'];
|
||||||
}
|
}
|
||||||
$str_bot = implode('', $bot);
|
$str_bot = implode('', $bot);
|
||||||
if($top !== NULL) {
|
if ($top !== null) {
|
||||||
$str_top = implode('', $top);
|
$str_top = implode('', $top);
|
||||||
$top_count = count($top);
|
$top_count = count($top);
|
||||||
if ($max == -1 || $top_count < $max) {
|
if ($max == -1 || $top_count < $max) {
|
||||||
|
@@ -23,7 +23,8 @@
|
|||||||
* @uses explode()
|
* @uses explode()
|
||||||
* @return bool success if valid lang is found, otherwise false
|
* @return bool success if valid lang is found, otherwise false
|
||||||
*/
|
*/
|
||||||
function PMA_langCheck() {
|
function PMA_langCheck()
|
||||||
|
{
|
||||||
// check forced language
|
// check forced language
|
||||||
if (! empty($GLOBALS['cfg']['Lang'])) {
|
if (! empty($GLOBALS['cfg']['Lang'])) {
|
||||||
if (PMA_langSet($GLOBALS['cfg']['Lang'])) {
|
if (PMA_langSet($GLOBALS['cfg']['Lang'])) {
|
||||||
@@ -82,7 +83,8 @@ function PMA_langCheck() {
|
|||||||
* @param string $lang language to set
|
* @param string $lang language to set
|
||||||
* @return bool success
|
* @return bool success
|
||||||
*/
|
*/
|
||||||
function PMA_langSet( &$lang ) {
|
function PMA_langSet(&$lang)
|
||||||
|
{
|
||||||
if (empty($lang) || empty($GLOBALS['available_languages'][$lang])) {
|
if (empty($lang) || empty($GLOBALS['available_languages'][$lang])) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -103,9 +105,14 @@ function PMA_langSet( &$lang ) {
|
|||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function PMA_langDetect( &$str, $envType ) {
|
function PMA_langDetect(&$str, $envType)
|
||||||
if ( empty( $str ) ) return false;
|
{
|
||||||
if ( empty( $GLOBALS['available_languages'] ) ) return false;
|
if (empty($str)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (empty($GLOBALS['available_languages'])) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($GLOBALS['available_languages'] as $lang => $value) {
|
foreach ($GLOBALS['available_languages'] as $lang => $value) {
|
||||||
// $envType = 1 for the 'HTTP_ACCEPT_LANGUAGE' environment variable,
|
// $envType = 1 for the 'HTTP_ACCEPT_LANGUAGE' environment variable,
|
||||||
|
@@ -51,7 +51,7 @@ if ($is_superuser) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$has_binlogs = FALSE;
|
$has_binlogs = FALSE;
|
||||||
$binlogs = PMA_DBI_try_query('SHOW MASTER LOGS', NULL, PMA_DBI_QUERY_STORE);
|
$binlogs = PMA_DBI_try_query('SHOW MASTER LOGS', null, PMA_DBI_QUERY_STORE);
|
||||||
if ($binlogs) {
|
if ($binlogs) {
|
||||||
if (PMA_DBI_num_rows($binlogs) > 0) {
|
if (PMA_DBI_num_rows($binlogs) > 0) {
|
||||||
$binary_logs = array();
|
$binary_logs = array();
|
||||||
|
@@ -29,9 +29,7 @@ if (!@function_exists('session_name')) {
|
|||||||
. '&char=' . urlencode($charset)
|
. '&char=' . urlencode($charset)
|
||||||
. '&dir=' . urlencode($text_dir)
|
. '&dir=' . urlencode($text_dir)
|
||||||
. '&type=' . urlencode($strError)
|
. '&type=' . urlencode($strError)
|
||||||
. '&error=' . urlencode(
|
. '&error=' . urlencode(sprintf($strCantLoad, 'session')));
|
||||||
sprintf($strCantLoad, 'session'))
|
|
||||||
);
|
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,7 +80,8 @@ if ( version_compare( PHP_VERSION, '5.0.0', 'ge' )
|
|||||||
* @uses strip_tags() to prevent XSS attacks in SID
|
* @uses strip_tags() to prevent XSS attacks in SID
|
||||||
* @uses function_exists() for session_regenerate_id()
|
* @uses function_exists() for session_regenerate_id()
|
||||||
*/
|
*/
|
||||||
function PMA_secureSession() {
|
function PMA_secureSession()
|
||||||
|
{
|
||||||
// prevent session fixation and XSS
|
// prevent session fixation and XSS
|
||||||
if (function_exists('session_regenerate_id')) {
|
if (function_exists('session_regenerate_id')) {
|
||||||
session_regenerate_id(true);
|
session_regenerate_id(true);
|
||||||
|
@@ -58,7 +58,8 @@ require_once('./libraries/bookmark.lib.php'); // used for file listing
|
|||||||
* what part to display
|
* what part to display
|
||||||
* false if not inside querywindow
|
* false if not inside querywindow
|
||||||
*/
|
*/
|
||||||
function PMA_sqlQueryForm( $query = true, $display_tab = false ) {
|
function PMA_sqlQueryForm($query = true, $display_tab = false)
|
||||||
|
{
|
||||||
// check tab to display if inside querywindow
|
// check tab to display if inside querywindow
|
||||||
if (! $display_tab) {
|
if (! $display_tab) {
|
||||||
$display_tab = 'full';
|
$display_tab = 'full';
|
||||||
@@ -177,7 +178,8 @@ function PMA_sqlQueryForm( $query = true, $display_tab = false ) {
|
|||||||
* @param string $query query to display in the textarea
|
* @param string $query query to display in the textarea
|
||||||
* @param boolean $is_querywindow if inside querywindow or not
|
* @param boolean $is_querywindow if inside querywindow or not
|
||||||
*/
|
*/
|
||||||
function PMA_sqlQueryFormInsert( $query = '', $is_querywindow = false ) {
|
function PMA_sqlQueryFormInsert($query = '', $is_querywindow = false)
|
||||||
|
{
|
||||||
|
|
||||||
// enable auto select text in textarea
|
// enable auto select text in textarea
|
||||||
if ($GLOBALS['cfg']['TextareaAutoSelect']) {
|
if ($GLOBALS['cfg']['TextareaAutoSelect']) {
|
||||||
@@ -382,7 +384,8 @@ function PMA_sqlQueryFormInsert( $query = '', $is_querywindow = false ) {
|
|||||||
* @uses count()
|
* @uses count()
|
||||||
* @uses htmlspecialchars()
|
* @uses htmlspecialchars()
|
||||||
*/
|
*/
|
||||||
function PMA_sqlQueryFormBookmark() {
|
function PMA_sqlQueryFormBookmark()
|
||||||
|
{
|
||||||
$bookmark_list = PMA_listBookmarks(isset($GLOBALS['db']) ? $GLOBALS['db'] : '', $GLOBALS['cfg']['Bookmark'] );
|
$bookmark_list = PMA_listBookmarks(isset($GLOBALS['db']) ? $GLOBALS['db'] : '', $GLOBALS['cfg']['Bookmark'] );
|
||||||
if (! $bookmark_list || count($bookmark_list) < 1) {
|
if (! $bookmark_list || count($bookmark_list) < 1) {
|
||||||
return;
|
return;
|
||||||
@@ -525,7 +528,7 @@ function PMA_sqlQueryFormUpload() {
|
|||||||
} elseif (PMA_MYSQL_INT_VERSION >= 40100) {
|
} elseif (PMA_MYSQL_INT_VERSION >= 40100) {
|
||||||
echo $GLOBALS['strCharsetOfFile'] . "\n";
|
echo $GLOBALS['strCharsetOfFile'] . "\n";
|
||||||
echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET,
|
echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET,
|
||||||
'charset_of_file', NULL, 'utf8', FALSE );
|
'charset_of_file', null, 'utf8', FALSE);
|
||||||
} // end if (recoding)
|
} // end if (recoding)
|
||||||
echo '<input type="submit" name="SQL" value="' . $GLOBALS['strGo']
|
echo '<input type="submit" name="SQL" value="' . $GLOBALS['strGo']
|
||||||
.'" />' . "\n";
|
.'" />' . "\n";
|
||||||
|
@@ -77,7 +77,8 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
|||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
// Added, Robbat2 - 13 Janurary 2003, 2:59PM
|
// Added, Robbat2 - 13 Janurary 2003, 2:59PM
|
||||||
function PMA_SQP_resetError() {
|
function PMA_SQP_resetError()
|
||||||
|
{
|
||||||
global $SQP_errorString;
|
global $SQP_errorString;
|
||||||
$SQP_errorString = '';
|
$SQP_errorString = '';
|
||||||
unset($SQP_errorString);
|
unset($SQP_errorString);
|
||||||
@@ -91,7 +92,8 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
|||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
// Added, Robbat2 - 13 Janurary 2003, 2:59PM
|
// Added, Robbat2 - 13 Janurary 2003, 2:59PM
|
||||||
function PMA_SQP_getErrorString() {
|
function PMA_SQP_getErrorString()
|
||||||
|
{
|
||||||
global $SQP_errorString;
|
global $SQP_errorString;
|
||||||
return isset($SQP_errorString) ? $SQP_errorString : '';
|
return isset($SQP_errorString) ? $SQP_errorString : '';
|
||||||
}
|
}
|
||||||
@@ -104,7 +106,8 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
|||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
// Added, Robbat2 - 13 Janurary 2003, 2:59PM
|
// Added, Robbat2 - 13 Janurary 2003, 2:59PM
|
||||||
function PMA_SQP_isError() {
|
function PMA_SQP_isError()
|
||||||
|
{
|
||||||
global $SQP_errorString;
|
global $SQP_errorString;
|
||||||
return isset($SQP_errorString) && !empty($SQP_errorString);
|
return isset($SQP_errorString) && !empty($SQP_errorString);
|
||||||
}
|
}
|
||||||
@@ -394,11 +397,15 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
|||||||
if ($is_hex_digit) {
|
if ($is_hex_digit) {
|
||||||
$count2++;
|
$count2++;
|
||||||
$pos = strspn($sql, '0123456789abcdefABCDEF', $count2);
|
$pos = strspn($sql, '0123456789abcdefABCDEF', $count2);
|
||||||
if ($pos > $count2) $count2 = $pos;
|
if ($pos > $count2) {
|
||||||
|
$count2 = $pos;
|
||||||
|
}
|
||||||
unset($pos);
|
unset($pos);
|
||||||
} elseif ($is_digit) {
|
} elseif ($is_digit) {
|
||||||
$pos = strspn($sql, '0123456789', $count2);
|
$pos = strspn($sql, '0123456789', $count2);
|
||||||
if ($pos > $count2) $count2 = $pos;
|
if ($pos > $count2) {
|
||||||
|
$count2 = $pos;
|
||||||
|
}
|
||||||
unset($pos);
|
unset($pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -456,8 +463,7 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
|||||||
} else {
|
} else {
|
||||||
$type .= '_integer';
|
$type .= '_integer';
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if ($is_sql_variable != FALSE) {
|
if ($is_sql_variable != FALSE) {
|
||||||
$type = 'alpha_variable';
|
$type = 'alpha_variable';
|
||||||
} else {
|
} else {
|
||||||
@@ -499,12 +505,10 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
PMA_SQP_arrayAdd($sql_array, 'punct' . $t_suffix, $punct_data, $arraysize);
|
PMA_SQP_arrayAdd($sql_array, 'punct' . $t_suffix, $punct_data, $arraysize);
|
||||||
}
|
} elseif (PMA_STR_binarySearchInArr($punct_data, $allpunct_list_pair, $allpunct_list_pair_size)) {
|
||||||
else if (PMA_STR_binarySearchInArr($punct_data, $allpunct_list_pair, $allpunct_list_pair_size)) {
|
|
||||||
// Ok, we have one of the valid combined punct expressions
|
// Ok, we have one of the valid combined punct expressions
|
||||||
PMA_SQP_arrayAdd($sql_array, 'punct', $punct_data, $arraysize);
|
PMA_SQP_arrayAdd($sql_array, 'punct', $punct_data, $arraysize);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Bad luck, lets split it up more
|
// Bad luck, lets split it up more
|
||||||
$first = $punct_data[0];
|
$first = $punct_data[0];
|
||||||
$first2 = $punct_data[0] . $punct_data[1];
|
$first2 = $punct_data[0] . $punct_data[1];
|
||||||
@@ -703,7 +707,9 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
|||||||
*/
|
*/
|
||||||
function PMA_SQP_analyze($arr)
|
function PMA_SQP_analyze($arr)
|
||||||
{
|
{
|
||||||
if ($arr == array()) return array();
|
if ($arr == array()) {
|
||||||
|
return array();
|
||||||
|
}
|
||||||
$result = array();
|
$result = array();
|
||||||
$size = $arr['len'];
|
$size = $arr['len'];
|
||||||
$subresult = array(
|
$subresult = array(
|
||||||
@@ -1978,7 +1984,7 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) {
|
|||||||
// array_push($typearr, $arr[$i + 1]['type']);
|
// array_push($typearr, $arr[$i + 1]['type']);
|
||||||
$typearr[4] = $arr[$i + 1]['type'];
|
$typearr[4] = $arr[$i + 1]['type'];
|
||||||
} else {
|
} else {
|
||||||
//array_push($typearr, NULL);
|
//array_push($typearr, null);
|
||||||
$typearr[4] = '';
|
$typearr[4] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -54,8 +54,8 @@ if (!function_exists('class_exists') || !class_exists('SOAP_Client')) {
|
|||||||
var $connection_technology_version;
|
var $connection_technology_version;
|
||||||
var $interactive;
|
var $interactive;
|
||||||
|
|
||||||
var $service_link = NULL;
|
var $service_link = null;
|
||||||
var $session_data = NULL;
|
var $session_data = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -185,8 +185,8 @@ if (!function_exists('class_exists') || !class_exists('SOAP_Client')) {
|
|||||||
$this->connection_technology_version = phpversion();
|
$this->connection_technology_version = phpversion();
|
||||||
$this->interactive = 1;
|
$this->interactive = 1;
|
||||||
|
|
||||||
$this->service_link = NULL;
|
$this->service_link = null;
|
||||||
$this->session_data = NULL;
|
$this->session_data = null;
|
||||||
} // end of the "PMA_SQLValidator()" function
|
} // end of the "PMA_SQLValidator()" function
|
||||||
|
|
||||||
|
|
||||||
@@ -347,7 +347,7 @@ if (!function_exists('class_exists') || !class_exists('SOAP_Client')) {
|
|||||||
$this->connection_technology, $this->connection_technology_version,
|
$this->connection_technology, $this->connection_technology_version,
|
||||||
$this->interactive);
|
$this->interactive);
|
||||||
|
|
||||||
if (isset($this->session_data) && ($this->session_data != NULL)
|
if (isset($this->session_data) && ($this->session_data != null)
|
||||||
&& ($this->session_data->target != $this->url)) {
|
&& ($this->session_data->target != $this->url)) {
|
||||||
// Reopens the service on the new URL that was provided
|
// Reopens the service on the new URL that was provided
|
||||||
$url = $this->session_data->target;
|
$url = $this->session_data->target;
|
||||||
|
@@ -50,8 +50,7 @@ if ($action == 'tbl_create.php') {
|
|||||||
?>
|
?>
|
||||||
<input type="hidden" name="reload" value="1" />
|
<input type="hidden" name="reload" value="1" />
|
||||||
<?php
|
<?php
|
||||||
}
|
} elseif ($action == 'tbl_addfield.php') {
|
||||||
elseif ($action == 'tbl_addfield.php') {
|
|
||||||
?>
|
?>
|
||||||
<input type="hidden" name="field_where" value="<?php echo $field_where; ?>" />
|
<input type="hidden" name="field_where" value="<?php echo $field_where; ?>" />
|
||||||
<input type="hidden" name="after_field" value="<?php echo $after_field; ?>" />
|
<input type="hidden" name="after_field" value="<?php echo $after_field; ?>" />
|
||||||
@@ -244,8 +243,7 @@ for ( $i = 0 ; $i <= $num_fields; $i++ ) {
|
|||||||
if (empty($row['Type'])) {
|
if (empty($row['Type'])) {
|
||||||
$row['Type'] = '';
|
$row['Type'] = '';
|
||||||
$type = '';
|
$type = '';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$type = $row['Type'];
|
$type = $row['Type'];
|
||||||
}
|
}
|
||||||
// set or enum types: slashes single quotes inside options
|
// set or enum types: slashes single quotes inside options
|
||||||
@@ -323,7 +321,7 @@ for ( $i = 0 ; $i <= $num_fields; $i++ ) {
|
|||||||
$ci++;
|
$ci++;
|
||||||
|
|
||||||
if (PMA_MYSQL_INT_VERSION >= 40100) {
|
if (PMA_MYSQL_INT_VERSION >= 40100) {
|
||||||
$tmp_collation = empty($row['Collation']) ? NULL : $row['Collation'];
|
$tmp_collation = empty($row['Collation']) ? null : $row['Collation'];
|
||||||
$content_cells[$i][$ci] = PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'field_collation[]', 'field_' . $i . '_' . ($ci - $ci_offset), $tmp_collation, FALSE);
|
$content_cells[$i][$ci] = PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'field_collation[]', 'field_' . $i . '_' . ($ci - $ci_offset), $tmp_collation, FALSE);
|
||||||
unset($tmp_collation);
|
unset($tmp_collation);
|
||||||
$ci++;
|
$ci++;
|
||||||
@@ -613,7 +611,7 @@ var odd_row = <?php echo $odd_row; ?>;
|
|||||||
function addField() {
|
function addField() {
|
||||||
var new_fields = document.getElementById('added_fields').value;
|
var new_fields = document.getElementById('added_fields').value;
|
||||||
var new_field_container = document.getElementById('table_columns');
|
var new_field_container = document.getElementById('table_columns');
|
||||||
var new_field = '<?php echo preg_replace( '<27>\s+<2B>', ' ', preg_replace( '<27>\'<27>', '\\\'', $new_field ) ); ?>';
|
var new_field = '<?php echo preg_replace( '<27>\s+<2B>', ' ', preg_replace( '<27>\'<27>', '\\\'', $new_field ) ); ?>';
|
||||||
var i = 0;
|
var i = 0;
|
||||||
for ( i = 0; i < new_fields; i++ ) {
|
for ( i = 0; i < new_fields; i++ ) {
|
||||||
if ( odd_row ) {
|
if ( odd_row ) {
|
||||||
@@ -653,13 +651,13 @@ if ($action == 'tbl_create.php') {
|
|||||||
</td>
|
</td>
|
||||||
<td width="25"> </td>
|
<td width="25"> </td>
|
||||||
<td>
|
<td>
|
||||||
<?php echo PMA_generateEnginesDropdown('tbl_type', NULL, FALSE, (isset($GLOBALS['tbl_type']) ? $GLOBALS['tbl_type'] : NULL), 3); ?>
|
<?php echo PMA_generateEnginesDropdown('tbl_type', null, FALSE, (isset($GLOBALS['tbl_type']) ? $GLOBALS['tbl_type'] : null), 3); ?>
|
||||||
</td>
|
</td>
|
||||||
<?php
|
<?php
|
||||||
if ( PMA_MYSQL_INT_VERSION >= 40100 ) {
|
if ( PMA_MYSQL_INT_VERSION >= 40100 ) {
|
||||||
echo ' <td width="25"> </td>' . "\n"
|
echo ' <td width="25"> </td>' . "\n"
|
||||||
. ' <td>' . "\n"
|
. ' <td>' . "\n"
|
||||||
. PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'tbl_collation', NULL, (isset($tbl_collation) ? $tbl_collation : NULL), FALSE, 3)
|
. PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'tbl_collation', null, (isset($tbl_collation) ? $tbl_collation : null), FALSE, 3)
|
||||||
. ' </td>' . "\n";
|
. ' </td>' . "\n";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@@ -66,7 +66,7 @@ $tabs['export']['args']['single_table'] = 'true';
|
|||||||
$tabs['export']['text'] = $strExport;
|
$tabs['export']['text'] = $strExport;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Don't display , "Import", "Operations" and "Empty"
|
* Don't display "Import", "Operations" and "Empty"
|
||||||
* for views and information_schema
|
* for views and information_schema
|
||||||
*/
|
*/
|
||||||
if ( ! $tbl_is_view && ! (isset($db_is_information_schema) && $db_is_information_schema )) {
|
if ( ! $tbl_is_view && ! (isset($db_is_information_schema) && $db_is_information_schema )) {
|
||||||
|
@@ -112,8 +112,11 @@ if (!$check_stop) {
|
|||||||
|
|
||||||
// f i e l d v a l u e i n t h e f o r m
|
// f i e l d v a l u e i n t h e f o r m
|
||||||
|
|
||||||
if (isset($me_fields_type[$encoded_key])) $type = $me_fields_type[$encoded_key];
|
if (isset($me_fields_type[$encoded_key])) {
|
||||||
else $type = '';
|
$type = $me_fields_type[$encoded_key];
|
||||||
|
} else {
|
||||||
|
$type = '';
|
||||||
|
}
|
||||||
|
|
||||||
$f = 'field_' . md5($key);
|
$f = 'field_' . md5($key);
|
||||||
$t_fval = (isset($$f) ? $$f : null);
|
$t_fval = (isset($$f) ? $$f : null);
|
||||||
|
@@ -106,7 +106,8 @@
|
|||||||
* @uses SimpleUnzip::ReadFile() Opens file on new if specified
|
* @uses SimpleUnzip::ReadFile() Opens file on new if specified
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
function SimpleUnzip($in_FileName = '') {
|
function SimpleUnzip($in_FileName = '')
|
||||||
|
{
|
||||||
if ($in_FileName !== '') {
|
if ($in_FileName !== '') {
|
||||||
SimpleUnzip::ReadFile($in_FileName);
|
SimpleUnzip::ReadFile($in_FileName);
|
||||||
}
|
}
|
||||||
@@ -120,7 +121,8 @@
|
|||||||
* @uses $Entries
|
* @uses $Entries
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
function Count() {
|
function Count()
|
||||||
|
{
|
||||||
return count($this->Entries);
|
return count($this->Entries);
|
||||||
} // end of the 'Count()' method
|
} // end of the 'Count()' method
|
||||||
|
|
||||||
@@ -133,7 +135,8 @@
|
|||||||
* @access public
|
* @access public
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
function GetData($in_Index) {
|
function GetData($in_Index)
|
||||||
|
{
|
||||||
return $this->Entries[$in_Index]->Data;
|
return $this->Entries[$in_Index]->Data;
|
||||||
} // end of the 'GetData()' method
|
} // end of the 'GetData()' method
|
||||||
|
|
||||||
@@ -146,7 +149,8 @@
|
|||||||
* @access public
|
* @access public
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
function GetEntry($in_Index) {
|
function GetEntry($in_Index)
|
||||||
|
{
|
||||||
return $this->Entries[$in_Index];
|
return $this->Entries[$in_Index];
|
||||||
} // end of the 'GetEntry()' method
|
} // end of the 'GetEntry()' method
|
||||||
|
|
||||||
@@ -159,7 +163,8 @@
|
|||||||
* @access public
|
* @access public
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
function GetError($in_Index) {
|
function GetError($in_Index)
|
||||||
|
{
|
||||||
return $this->Entries[$in_Index]->Error;
|
return $this->Entries[$in_Index]->Error;
|
||||||
} // end of the 'GetError()' method
|
} // end of the 'GetError()' method
|
||||||
|
|
||||||
@@ -172,7 +177,8 @@
|
|||||||
* @access public
|
* @access public
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
function GetErrorMsg($in_Index) {
|
function GetErrorMsg($in_Index)
|
||||||
|
{
|
||||||
return $this->Entries[$in_Index]->ErrorMsg;
|
return $this->Entries[$in_Index]->ErrorMsg;
|
||||||
} // end of the 'GetErrorMsg()' method
|
} // end of the 'GetErrorMsg()' method
|
||||||
|
|
||||||
@@ -185,7 +191,8 @@
|
|||||||
* @access public
|
* @access public
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
function GetName($in_Index) {
|
function GetName($in_Index)
|
||||||
|
{
|
||||||
return $this->Entries[$in_Index]->Name;
|
return $this->Entries[$in_Index]->Name;
|
||||||
} // end of the 'GetName()' method
|
} // end of the 'GetName()' method
|
||||||
|
|
||||||
@@ -198,7 +205,8 @@
|
|||||||
* @access public
|
* @access public
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
function GetPath($in_Index) {
|
function GetPath($in_Index)
|
||||||
|
{
|
||||||
return $this->Entries[$in_Index]->Path;
|
return $this->Entries[$in_Index]->Path;
|
||||||
} // end of the 'GetPath()' method
|
} // end of the 'GetPath()' method
|
||||||
|
|
||||||
@@ -211,7 +219,8 @@
|
|||||||
* @access public
|
* @access public
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
function GetTime($in_Index) {
|
function GetTime($in_Index)
|
||||||
|
{
|
||||||
return $this->Entries[$in_Index]->Time;
|
return $this->Entries[$in_Index]->Time;
|
||||||
} // end of the 'GetTime()' method
|
} // end of the 'GetTime()' method
|
||||||
|
|
||||||
@@ -224,7 +233,8 @@
|
|||||||
* @access public
|
* @access public
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
function ReadFile($in_FileName) {
|
function ReadFile($in_FileName)
|
||||||
|
{
|
||||||
$this->Entries = array();
|
$this->Entries = array();
|
||||||
|
|
||||||
// Get file parameters
|
// Get file parameters
|
||||||
@@ -300,13 +310,11 @@
|
|||||||
if (strlen($vZ) != $aP['CS']) {
|
if (strlen($vZ) != $aP['CS']) {
|
||||||
$aI['E'] = 1;
|
$aI['E'] = 1;
|
||||||
$aI['EM'] = 'Compressed size is not equal with the value in header information.';
|
$aI['EM'] = 'Compressed size is not equal with the value in header information.';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if ($bE) {
|
if ($bE) {
|
||||||
$aI['E'] = 5;
|
$aI['E'] = 5;
|
||||||
$aI['EM'] = 'File is encrypted, which is not supported from this class.';
|
$aI['EM'] = 'File is encrypted, which is not supported from this class.';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
switch($aP['CM']) {
|
switch($aP['CM']) {
|
||||||
case 0: // Stored
|
case 0: // Stored
|
||||||
// Here is nothing to do, the file ist flat.
|
// Here is nothing to do, the file ist flat.
|
||||||
@@ -321,8 +329,7 @@
|
|||||||
if (! extension_loaded('bz2')) {
|
if (! extension_loaded('bz2')) {
|
||||||
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
|
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
|
||||||
@dl('php_bz2.dll');
|
@dl('php_bz2.dll');
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
@dl('bz2.so');
|
@dl('bz2.so');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -331,8 +338,7 @@
|
|||||||
// 2003-12-02 - HB <
|
// 2003-12-02 - HB <
|
||||||
$vZ = bzdecompress($vZ);
|
$vZ = bzdecompress($vZ);
|
||||||
// 2003-12-02 - HB >
|
// 2003-12-02 - HB >
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$aI['E'] = 7;
|
$aI['E'] = 7;
|
||||||
$aI['EM'] = "PHP BZIP2 extension not available.";
|
$aI['EM'] = "PHP BZIP2 extension not available.";
|
||||||
}
|
}
|
||||||
@@ -351,13 +357,11 @@
|
|||||||
if ($vZ === FALSE) {
|
if ($vZ === FALSE) {
|
||||||
$aI['E'] = 2;
|
$aI['E'] = 2;
|
||||||
$aI['EM'] = 'Decompression of data failed.';
|
$aI['EM'] = 'Decompression of data failed.';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (strlen($vZ) != $aP['UCS']) {
|
if (strlen($vZ) != $aP['UCS']) {
|
||||||
$aI['E'] = 3;
|
$aI['E'] = 3;
|
||||||
$aI['EM'] = 'Uncompressed size is not equal with the value in header information.';
|
$aI['EM'] = 'Uncompressed size is not equal with the value in header information.';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (crc32($vZ) != $aP['CRC']) {
|
if (crc32($vZ) != $aP['CRC']) {
|
||||||
$aI['E'] = 4;
|
$aI['E'] = 4;
|
||||||
$aI['EM'] = 'CRC32 checksum is not equal with the value in header information.';
|
$aI['EM'] = 'CRC32 checksum is not equal with the value in header information.';
|
||||||
@@ -475,7 +479,8 @@
|
|||||||
* @access public
|
* @access public
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
function SimpleUnzipEntry($in_Entry) {
|
function SimpleUnzipEntry($in_Entry)
|
||||||
|
{
|
||||||
$this->Data = $in_Entry['D'];
|
$this->Data = $in_Entry['D'];
|
||||||
$this->Error = $in_Entry['E'];
|
$this->Error = $in_Entry['E'];
|
||||||
$this->ErrorMsg = $in_Entry['EM'];
|
$this->ErrorMsg = $in_Entry['EM'];
|
||||||
|
@@ -65,10 +65,14 @@ function PMA_generate_common_hidden_inputs( $db = '', $table = '', $indent = 0,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( ! is_array($skip) ) {
|
if ( ! is_array($skip) ) {
|
||||||
if ( isset( $params[$skip] ) ) unset( $params[$skip] );
|
if ( isset( $params[$skip] ) ) {
|
||||||
|
unset( $params[$skip] );
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
foreach ( $skip as $skipping ) {
|
foreach ( $skip as $skipping ) {
|
||||||
if ( isset( $params[$skipping] ) ) unset( $params[$skipping] );
|
if ( isset( $params[$skipping] ) ) {
|
||||||
|
unset( $params[$skipping] );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
17
main.php
17
main.php
@@ -90,8 +90,8 @@ if (!$cfg['LeftDisplayServers'] && (count($cfg['Servers']) > 1 || $server == 0 &
|
|||||||
if ( $server > 0 ) {
|
if ( $server > 0 ) {
|
||||||
echo '<ul>' . "\n";
|
echo '<ul>' . "\n";
|
||||||
|
|
||||||
PMA_printListItem( $strProtocolVersion . ': ' . PMA_DBI_get_proto_info()
|
PMA_printListItem( $strProtocolVersion . ': ' . PMA_DBI_get_proto_info(),
|
||||||
, 'li_mysql_proto' );
|
'li_mysql_proto' );
|
||||||
PMA_printListItem( $strServer . ': ' . $server_info, 'li_server_info' );
|
PMA_printListItem( $strServer . ': ' . $server_info, 'li_server_info' );
|
||||||
PMA_printListItem( $strUser . ': ' . htmlspecialchars( $mysql_cur_user_and_host ),
|
PMA_printListItem( $strUser . ': ' . htmlspecialchars( $mysql_cur_user_and_host ),
|
||||||
'li_user_info' );
|
'li_user_info' );
|
||||||
@@ -131,7 +131,7 @@ if ( $server > 0 ) {
|
|||||||
. ' </li>' . "\n"
|
. ' </li>' . "\n"
|
||||||
. ' <li id="li_select_mysql_collation">';
|
. ' <li id="li_select_mysql_collation">';
|
||||||
echo ' <form method="post" action="index.php" target="_parent">' . "\n"
|
echo ' <form method="post" action="index.php" target="_parent">' . "\n"
|
||||||
. PMA_generate_common_hidden_inputs(NULL, NULL, 4, 'collation_connection')
|
. PMA_generate_common_hidden_inputs(null, null, 4, 'collation_connection')
|
||||||
. ' <label for="select_collation_connection">' . "\n"
|
. ' <label for="select_collation_connection">' . "\n"
|
||||||
. ' ' . $strMySQLConnectionCollation . ': ' . "\n"
|
. ' ' . $strMySQLConnectionCollation . ': ' . "\n"
|
||||||
. ' </label>' . "\n"
|
. ' </label>' . "\n"
|
||||||
@@ -172,7 +172,7 @@ if ( $server > 0 ) {
|
|||||||
'./server_privileges.php?' . $common_url_query );
|
'./server_privileges.php?' . $common_url_query );
|
||||||
}
|
}
|
||||||
|
|
||||||
$binlogs = PMA_DBI_try_query('SHOW MASTER LOGS', NULL, PMA_DBI_QUERY_STORE);
|
$binlogs = PMA_DBI_try_query('SHOW MASTER LOGS', null, PMA_DBI_QUERY_STORE);
|
||||||
if ( $binlogs ) {
|
if ( $binlogs ) {
|
||||||
if (PMA_DBI_num_rows($binlogs) > 0) {
|
if (PMA_DBI_num_rows($binlogs) > 0) {
|
||||||
PMA_printListItem( $strBinaryLog, 'li_mysql_binlogs',
|
PMA_printListItem( $strBinaryLog, 'li_mysql_binlogs',
|
||||||
@@ -371,18 +371,19 @@ if (defined('PMA_MYSQL_INT_VERSION') && PMA_MYSQL_INT_VERSION < 32332) {
|
|||||||
* @param string $id id, used for css styles
|
* @param string $id id, used for css styles
|
||||||
* @param string $url make item as link with $url as target
|
* @param string $url make item as link with $url as target
|
||||||
*/
|
*/
|
||||||
function PMA_printListItem( $name, $id = NULL, $url = NULL, $mysql_help_page = NULL ) {
|
function PMA_printListItem($name, $id = null, $url = null, $mysql_help_page = null)
|
||||||
|
{
|
||||||
echo '<li id="' . $id . '">';
|
echo '<li id="' . $id . '">';
|
||||||
if ( NULL !== $url ) {
|
if (null !== $url) {
|
||||||
echo '<a href="' . $url . '">';
|
echo '<a href="' . $url . '">';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $name;
|
echo $name;
|
||||||
|
|
||||||
if ( NULL !== $url ) {
|
if (null !== $url) {
|
||||||
echo '</a>' . "\n";
|
echo '</a>' . "\n";
|
||||||
}
|
}
|
||||||
if ( NULL !== $mysql_help_page ) {
|
if (null !== $mysql_help_page) {
|
||||||
echo PMA_showMySQLDocu('', $mysql_help_page);
|
echo PMA_showMySQLDocu('', $mysql_help_page);
|
||||||
}
|
}
|
||||||
echo '</li>';
|
echo '</li>';
|
||||||
|
@@ -223,7 +223,7 @@ if ($cfgRelation['pdfwork']) {
|
|||||||
|
|
||||||
// We will need an array of all tables in this db
|
// We will need an array of all tables in this db
|
||||||
$selectboxall = array('--');
|
$selectboxall = array('--');
|
||||||
$alltab_rs = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', NULL, PMA_DBI_QUERY_STORE);
|
$alltab_rs = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db) . ';', null, PMA_DBI_QUERY_STORE);
|
||||||
while ($val = @PMA_DBI_fetch_row($alltab_rs)) {
|
while ($val = @PMA_DBI_fetch_row($alltab_rs)) {
|
||||||
$selectboxall[] = $val[0];
|
$selectboxall[] = $val[0];
|
||||||
}
|
}
|
||||||
|
429
pdf_schema.php
429
pdf_schema.php
File diff suppressed because it is too large
Load Diff
@@ -93,8 +93,7 @@ if (!empty($bug_encoded)) {
|
|||||||
} else {
|
} else {
|
||||||
$result = 'Error: "gzuncompress()" is unavailable!' . "\n";
|
$result = 'Error: "gzuncompress()" is unavailable!' . "\n";
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$result = PMA_printDecodedBug($bug_decoded);
|
$result = PMA_printDecodedBug($bug_decoded);
|
||||||
} // end if... else...
|
} // end if... else...
|
||||||
|
|
||||||
|
@@ -510,12 +510,15 @@ function compress_servers(&$cfg) {
|
|||||||
*
|
*
|
||||||
* @return array array with grabbed values
|
* @return array array with grabbed values
|
||||||
*/
|
*/
|
||||||
function grab_values($list) {
|
function grab_values($list)
|
||||||
|
{
|
||||||
$a = split(';', $list);
|
$a = split(';', $list);
|
||||||
$res = array();
|
$res = array();
|
||||||
foreach ($a as $val) {
|
foreach ($a as $val) {
|
||||||
$v = split(':', $val);
|
$v = split(':', $val);
|
||||||
if (!isset($v[1])) $v[1] = '';
|
if (!isset($v[1])) {
|
||||||
|
$v[1] = '';
|
||||||
|
}
|
||||||
switch($v[1]) {
|
switch($v[1]) {
|
||||||
case 'bool':
|
case 'bool':
|
||||||
$res[$v[0]] = isset($_POST[$v[0]]);
|
$res[$v[0]] = isset($_POST[$v[0]]);
|
||||||
@@ -605,7 +608,9 @@ function show_overview($title, $list, $buttons = '') {
|
|||||||
function show_config_form($list, $legend, $help, $defaults = array(), $save = '', $prefix = '') {
|
function show_config_form($list, $legend, $help, $defaults = array(), $save = '', $prefix = '') {
|
||||||
global $PMA_Config;
|
global $PMA_Config;
|
||||||
|
|
||||||
if (empty($save)) $save = 'Update';
|
if (empty($save)) {
|
||||||
|
$save = 'Update';
|
||||||
|
}
|
||||||
|
|
||||||
echo '<fieldset class="optbox">' . "\n";
|
echo '<fieldset class="optbox">' . "\n";
|
||||||
echo '<legend>' . $legend . '</legend>' . "\n";
|
echo '<legend>' . $legend . '</legend>' . "\n";
|
||||||
@@ -614,9 +619,13 @@ function show_config_form($list, $legend, $help, $defaults = array(), $save = ''
|
|||||||
echo '<div class="opts">';
|
echo '<div class="opts">';
|
||||||
$type = 'text';
|
$type = 'text';
|
||||||
if (isset($val[3])) {
|
if (isset($val[3])) {
|
||||||
if (is_array($val[3])) $type = 'select';
|
if (is_array($val[3])) {
|
||||||
elseif (is_bool($val[3])) $type = 'check';
|
$type = 'select';
|
||||||
elseif ($val[3] == 'password') $type = 'password';
|
} elseif (is_bool($val[3])) {
|
||||||
|
$type = 'check';
|
||||||
|
} elseif ($val[3] == 'password') {
|
||||||
|
$type = 'password';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'text':
|
case 'text':
|
||||||
@@ -1078,7 +1087,9 @@ function show_window_form($defaults = array()) {
|
|||||||
* @return string HTML for server selection
|
* @return string HTML for server selection
|
||||||
*/
|
*/
|
||||||
function get_server_selection($cfg) {
|
function get_server_selection($cfg) {
|
||||||
if (count($cfg['Servers']) == 0) return '';
|
if (count($cfg['Servers']) == 0) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
$ret = '<select name="server">';
|
$ret = '<select name="server">';
|
||||||
foreach ($cfg['Servers'] as $key => $val) {
|
foreach ($cfg['Servers'] as $key => $val) {
|
||||||
$ret .= '<option value="' . $key . '">' . get_server_name($val, $key) . '</option>';
|
$ret .= '<option value="' . $key . '">' . get_server_name($val, $key) . '</option>';
|
||||||
@@ -1300,11 +1311,15 @@ switch ($action) {
|
|||||||
show_server_form($defaults);
|
show_server_form($defaults);
|
||||||
break;
|
break;
|
||||||
case 'editserver':
|
case 'editserver':
|
||||||
if (!isset($_POST['server'])) footer();
|
if (!isset($_POST['server'])) {
|
||||||
|
footer();
|
||||||
|
}
|
||||||
show_server_form($configuration['Servers'][$_POST['server']], $_POST['server']);
|
show_server_form($configuration['Servers'][$_POST['server']], $_POST['server']);
|
||||||
break;
|
break;
|
||||||
case 'deleteserver':
|
case 'deleteserver':
|
||||||
if (!isset($_POST['server'])) footer();
|
if (!isset($_POST['server'])) {
|
||||||
|
footer();
|
||||||
|
}
|
||||||
message('notice', 'Deleted server ' . get_server_name($configuration['Servers'][$_POST['server']], $_POST['server']));
|
message('notice', 'Deleted server ' . get_server_name($configuration['Servers'][$_POST['server']], $_POST['server']));
|
||||||
unset($configuration['Servers'][$_POST['server']]);
|
unset($configuration['Servers'][$_POST['server']]);
|
||||||
compress_servers($configuration);
|
compress_servers($configuration);
|
||||||
|
@@ -24,7 +24,9 @@ echo '<h2>' . "\n"
|
|||||||
. ' ' . $strBinaryLog . "\n"
|
. ' ' . $strBinaryLog . "\n"
|
||||||
. '</h2>' . "\n";
|
. '</h2>' . "\n";
|
||||||
|
|
||||||
if (!isset($log)) $log = '';
|
if (!isset($log)) {
|
||||||
|
$log = '';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display log selector.
|
* Display log selector.
|
||||||
@@ -48,7 +50,9 @@ if (count($binary_logs) > 1) {
|
|||||||
|
|
||||||
|
|
||||||
$sql_query = 'SHOW BINLOG EVENTS';
|
$sql_query = 'SHOW BINLOG EVENTS';
|
||||||
if (!empty($log)) $sql_query .= ' IN \'' . $log . '\'';
|
if (!empty($log)) {
|
||||||
|
$sql_query .= ' IN \'' . $log . '\'';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends the query and buffers the result
|
* Sends the query and buffers the result
|
||||||
|
@@ -111,7 +111,7 @@ echo '<h2>' . "\n"
|
|||||||
* Gets the databases list
|
* Gets the databases list
|
||||||
*/
|
*/
|
||||||
if ($server > 0) {
|
if ($server > 0) {
|
||||||
$databases = PMA_DBI_get_databases_full( NULL, $dbstats );
|
$databases = PMA_DBI_get_databases_full(null, $dbstats);
|
||||||
} else {
|
} else {
|
||||||
$databases = array();
|
$databases = array();
|
||||||
}
|
}
|
||||||
|
@@ -567,11 +567,15 @@ function PMA_displayLoginInformationFields($mode = 'new', $indent = 0 ) {
|
|||||||
if ($val['Field'] == 'User') {
|
if ($val['Field'] == 'User') {
|
||||||
strtok($val['Type'], '()');
|
strtok($val['Type'], '()');
|
||||||
$v = strtok('()');
|
$v = strtok('()');
|
||||||
if (is_int($v)) $username_length = $v;
|
if (is_int($v)) {
|
||||||
|
$username_length = $v;
|
||||||
|
}
|
||||||
} elseif ($val['Field'] == 'Host') {
|
} elseif ($val['Field'] == 'Host') {
|
||||||
strtok($val['Type'], '()');
|
strtok($val['Type'], '()');
|
||||||
$v = strtok('()');
|
$v = strtok('()');
|
||||||
if (is_int($v)) $hostname_length = $v;
|
if (is_int($v)) {
|
||||||
|
$hostname_length = $v;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($fields_info);
|
unset($fields_info);
|
||||||
@@ -743,7 +747,7 @@ if (!empty($adduser_submit) || !empty($change_copy)) {
|
|||||||
.' = ' . PMA_convert_using(PMA_sqlAddslashes($username), 'quoted')
|
.' = ' . PMA_convert_using(PMA_sqlAddslashes($username), 'quoted')
|
||||||
.' AND ' . PMA_convert_using('Host')
|
.' AND ' . PMA_convert_using('Host')
|
||||||
.' = ' . PMA_convert_using($hostname, 'quoted') . ';',
|
.' = ' . PMA_convert_using($hostname, 'quoted') . ';',
|
||||||
NULL, PMA_DBI_QUERY_STORE );
|
null, PMA_DBI_QUERY_STORE);
|
||||||
if (PMA_DBI_num_rows($res) == 1) {
|
if (PMA_DBI_num_rows($res) == 1) {
|
||||||
PMA_DBI_free_result($res);
|
PMA_DBI_free_result($res);
|
||||||
$message = sprintf($GLOBALS['strUserAlreadyExists'], '[i]\'' . $username . '\'@\'' . $hostname . '\'[/i]');
|
$message = sprintf($GLOBALS['strUserAlreadyExists'], '[i]\'' . $username . '\'@\'' . $hostname . '\'[/i]');
|
||||||
@@ -884,7 +888,7 @@ if (!empty($change_copy)) {
|
|||||||
.' AND ' . PMA_convert_using('`Table_name`')
|
.' AND ' . PMA_convert_using('`Table_name`')
|
||||||
.' = ' . PMA_convert_using($row['Table_name'], 'quoted')
|
.' = ' . PMA_convert_using($row['Table_name'], 'quoted')
|
||||||
.';',
|
.';',
|
||||||
NULL, PMA_DBI_QUERY_STORE );
|
null, PMA_DBI_QUERY_STORE);
|
||||||
|
|
||||||
$tmp_privs1 = PMA_extractPrivInfo($row);
|
$tmp_privs1 = PMA_extractPrivInfo($row);
|
||||||
$tmp_privs2 = array(
|
$tmp_privs2 = array(
|
||||||
@@ -1286,7 +1290,7 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) )
|
|||||||
$sql_query .= (isset($initial) ? PMA_RangeOfUsers($initial) : '');
|
$sql_query .= (isset($initial) ? PMA_RangeOfUsers($initial) : '');
|
||||||
|
|
||||||
$sql_query .= ' ORDER BY `User` ASC, `Host` ASC;';
|
$sql_query .= ' ORDER BY `User` ASC, `Host` ASC;';
|
||||||
$res = PMA_DBI_try_query($sql_query, NULL, PMA_DBI_QUERY_STORE);
|
$res = PMA_DBI_try_query($sql_query, null, PMA_DBI_QUERY_STORE);
|
||||||
|
|
||||||
if (! $res) {
|
if (! $res) {
|
||||||
// the query failed! This may have two reasons:
|
// the query failed! This may have two reasons:
|
||||||
@@ -1295,7 +1299,7 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) )
|
|||||||
// so let's try a more simple query
|
// so let's try a more simple query
|
||||||
|
|
||||||
$sql_query = 'SELECT * FROM `mysql`.`user`';
|
$sql_query = 'SELECT * FROM `mysql`.`user`';
|
||||||
$res = PMA_DBI_try_query($sql_query, NULL, PMA_DBI_QUERY_STORE);
|
$res = PMA_DBI_try_query($sql_query, null, PMA_DBI_QUERY_STORE);
|
||||||
|
|
||||||
if (!$res) {
|
if (!$res) {
|
||||||
echo '<i>' . $GLOBALS['strNoPrivileges'] . '</i>' . "\n";
|
echo '<i>' . $GLOBALS['strNoPrivileges'] . '</i>' . "\n";
|
||||||
@@ -1377,7 +1381,7 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$initials = PMA_DBI_try_query('SELECT DISTINCT UPPER(LEFT(' . PMA_convert_using('User') . ',1)) FROM `user` ORDER BY `User` ASC', NULL, PMA_DBI_QUERY_STORE);
|
$initials = PMA_DBI_try_query('SELECT DISTINCT UPPER(LEFT(' . PMA_convert_using('User') . ',1)) FROM `user` ORDER BY `User` ASC', null, PMA_DBI_QUERY_STORE);
|
||||||
while (list($tmp_initial) = PMA_DBI_fetch_row($initials)) {
|
while (list($tmp_initial) = PMA_DBI_fetch_row($initials)) {
|
||||||
$array_initials[$tmp_initial] = TRUE;
|
$array_initials[$tmp_initial] = TRUE;
|
||||||
}
|
}
|
||||||
@@ -1557,7 +1561,7 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo ' : ' . $GLOBALS['strEditPrivileges'] . '</h2>' . "\n";
|
echo ' : ' . $GLOBALS['strEditPrivileges'] . '</h2>' . "\n";
|
||||||
$res = PMA_DBI_query('SELECT \'foo\' FROM `mysql`.`user` WHERE ' . PMA_convert_using('User') . ' = ' . PMA_convert_using(PMA_sqlAddslashes($username), 'quoted') . ' AND ' . PMA_convert_using('Host') . ' = ' . PMA_convert_using($hostname, 'quoted') . ';', NULL, PMA_DBI_QUERY_STORE);
|
$res = PMA_DBI_query('SELECT \'foo\' FROM `mysql`.`user` WHERE ' . PMA_convert_using('User') . ' = ' . PMA_convert_using(PMA_sqlAddslashes($username), 'quoted') . ' AND ' . PMA_convert_using('Host') . ' = ' . PMA_convert_using($hostname, 'quoted') . ';', null, PMA_DBI_QUERY_STORE);
|
||||||
$user_does_not_exists = (PMA_DBI_num_rows( $res ) < 1);
|
$user_does_not_exists = (PMA_DBI_num_rows( $res ) < 1);
|
||||||
PMA_DBI_free_result($res);
|
PMA_DBI_free_result($res);
|
||||||
unset($res);
|
unset($res);
|
||||||
@@ -1842,7 +1846,7 @@ if ( empty( $adduser ) && ( ! isset( $checkprivs ) || ! strlen($checkprivs) ) )
|
|||||||
} else {
|
} else {
|
||||||
echo ' <input type="hidden" name="dbname" value="' . htmlspecialchars($dbname) . '"/>' . "\n"
|
echo ' <input type="hidden" name="dbname" value="' . htmlspecialchars($dbname) . '"/>' . "\n"
|
||||||
. ' <label for="text_tablename">' . $GLOBALS['strAddPrivilegesOnTbl'] . ':</label>' . "\n";
|
. ' <label for="text_tablename">' . $GLOBALS['strAddPrivilegesOnTbl'] . ':</label>' . "\n";
|
||||||
if ($res = @PMA_DBI_try_query('SHOW TABLES FROM ' . PMA_backquote($dbname) . ';', NULL, PMA_DBI_QUERY_STORE)) {
|
if ($res = @PMA_DBI_try_query('SHOW TABLES FROM ' . PMA_backquote($dbname) . ';', null, PMA_DBI_QUERY_STORE)) {
|
||||||
$pred_tbl_array = array();
|
$pred_tbl_array = array();
|
||||||
while ($row = PMA_DBI_fetch_row($res)) {
|
while ($row = PMA_DBI_fetch_row($res)) {
|
||||||
if (!isset($found_rows) || !in_array($row[0], $found_rows)) {
|
if (!isset($found_rows) || !in_array($row[0], $found_rows)) {
|
||||||
|
@@ -304,7 +304,7 @@ foreach ( $server_status as $name => $value ) {
|
|||||||
unset( $server_status[$name] );
|
unset( $server_status[$name] );
|
||||||
} else {
|
} else {
|
||||||
foreach ( $allocations as $filter => $section ) {
|
foreach ( $allocations as $filter => $section ) {
|
||||||
if ( preg_match( '<27>^' . $filter . '<27>i', $name )
|
if ( preg_match( '<27>^' . $filter . '<27>i', $name )
|
||||||
&& isset( $server_status[$name] ) ) {
|
&& isset( $server_status[$name] ) ) {
|
||||||
unset( $server_status[$name] );
|
unset( $server_status[$name] );
|
||||||
$sections[$section]['vars'][$name] = $value;
|
$sections[$section]['vars'][$name] = $value;
|
||||||
|
13
sql.php
13
sql.php
@@ -372,13 +372,12 @@ else {
|
|||||||
if (isset($GLOBALS['show_as_php']) || !empty($GLOBALS['validatequery'])) {
|
if (isset($GLOBALS['show_as_php']) || !empty($GLOBALS['validatequery'])) {
|
||||||
unset($result);
|
unset($result);
|
||||||
$num_rows = 0;
|
$num_rows = 0;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// garvin: Measure query time. TODO-Item http://sourceforge.net/tracker/index.php?func=detail&aid=571934&group_id=23067&atid=377411
|
// garvin: Measure query time. TODO-Item http://sourceforge.net/tracker/index.php?func=detail&aid=571934&group_id=23067&atid=377411
|
||||||
list($usec, $sec) = explode(' ', microtime());
|
list($usec, $sec) = explode(' ', microtime());
|
||||||
$querytime_before = ((float)$usec + (float)$sec);
|
$querytime_before = ((float)$usec + (float)$sec);
|
||||||
|
|
||||||
$result = @PMA_DBI_try_query($full_sql_query, NULL, PMA_DBI_QUERY_STORE);
|
$result = @PMA_DBI_try_query($full_sql_query, null, PMA_DBI_QUERY_STORE);
|
||||||
|
|
||||||
list($usec, $sec) = explode(' ', microtime());
|
list($usec, $sec) = explode(' ', microtime());
|
||||||
$querytime_after = ((float)$usec + (float)$sec);
|
$querytime_after = ((float)$usec + (float)$sec);
|
||||||
@@ -430,8 +429,7 @@ else {
|
|||||||
// if we did not append a limit, set this to get a correct
|
// if we did not append a limit, set this to get a correct
|
||||||
// "Showing rows..." message
|
// "Showing rows..." message
|
||||||
$GLOBALS['session_max_rows'] = 'all';
|
$GLOBALS['session_max_rows'] = 'all';
|
||||||
}
|
} elseif ($is_select) {
|
||||||
else if ($is_select) {
|
|
||||||
|
|
||||||
// c o u n t q u e r y
|
// c o u n t q u e r y
|
||||||
|
|
||||||
@@ -643,7 +641,7 @@ else {
|
|||||||
if (!isset($table)) {
|
if (!isset($table)) {
|
||||||
$goto = 'db_details.php';
|
$goto = 'db_details.php';
|
||||||
} else {
|
} else {
|
||||||
$is_table = @PMA_DBI_query('SHOW TABLES LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\';', NULL, PMA_DBI_QUERY_STORE);
|
$is_table = @PMA_DBI_query('SHOW TABLES LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\';', null, PMA_DBI_QUERY_STORE);
|
||||||
if (!($is_table && @PMA_DBI_num_rows($is_table))) {
|
if (!($is_table && @PMA_DBI_num_rows($is_table))) {
|
||||||
$goto = 'db_details.php';
|
$goto = 'db_details.php';
|
||||||
unset($table);
|
unset($table);
|
||||||
@@ -675,8 +673,7 @@ else {
|
|||||||
}
|
}
|
||||||
$active_page = $goto;
|
$active_page = $goto;
|
||||||
require('./' . $goto);
|
require('./' . $goto);
|
||||||
} // end if file_exist
|
} else {
|
||||||
else {
|
|
||||||
PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . str_replace('&', '&', $goto) . '&message=' . urlencode($message));
|
PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . str_replace('&', '&', $goto) . '&message=' . urlencode($message));
|
||||||
} // end else
|
} // end else
|
||||||
exit();
|
exit();
|
||||||
|
@@ -136,7 +136,7 @@ unset($show_create_table);
|
|||||||
* Get the list of the fields of the current table
|
* Get the list of the fields of the current table
|
||||||
*/
|
*/
|
||||||
PMA_DBI_select_db($db);
|
PMA_DBI_select_db($db);
|
||||||
$table_def = PMA_DBI_query('SHOW FIELDS FROM ' . PMA_backquote($table) . ';', NULL, PMA_DBI_QUERY_STORE);
|
$table_def = PMA_DBI_query('SHOW FIELDS FROM ' . PMA_backquote($table) . ';', null, PMA_DBI_QUERY_STORE);
|
||||||
if (isset($primary_key)) {
|
if (isset($primary_key)) {
|
||||||
if (is_array($primary_key)) {
|
if (is_array($primary_key)) {
|
||||||
$primary_key_array = $primary_key;
|
$primary_key_array = $primary_key;
|
||||||
@@ -148,7 +148,7 @@ if (isset($primary_key)) {
|
|||||||
$result = array();
|
$result = array();
|
||||||
foreach ($primary_key_array AS $rowcount => $primary_key) {
|
foreach ($primary_key_array AS $rowcount => $primary_key) {
|
||||||
$local_query = 'SELECT * FROM ' . PMA_backquote($table) . ' WHERE ' . $primary_key . ';';
|
$local_query = 'SELECT * FROM ' . PMA_backquote($table) . ' WHERE ' . $primary_key . ';';
|
||||||
$result[$rowcount] = PMA_DBI_query($local_query, NULL, PMA_DBI_QUERY_STORE);
|
$result[$rowcount] = PMA_DBI_query($local_query, null, PMA_DBI_QUERY_STORE);
|
||||||
$row[$rowcount] = PMA_DBI_fetch_assoc($result[$rowcount]);
|
$row[$rowcount] = PMA_DBI_fetch_assoc($result[$rowcount]);
|
||||||
$primary_keys[$rowcount] = $primary_key;
|
$primary_keys[$rowcount] = $primary_key;
|
||||||
|
|
||||||
@@ -178,7 +178,7 @@ if (isset($primary_key)) {
|
|||||||
} // end if (no record returned)
|
} // end if (no record returned)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$result = PMA_DBI_query('SELECT * FROM ' . PMA_backquote($table) . ' LIMIT 1;', NULL, PMA_DBI_QUERY_STORE);
|
$result = PMA_DBI_query('SELECT * FROM ' . PMA_backquote($table) . ' LIMIT 1;', null, PMA_DBI_QUERY_STORE);
|
||||||
unset($row);
|
unset($row);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,7 +212,7 @@ document.onkeydown = onKeyDownArrowsHandler;
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<!-- Change table properties form -->
|
<!-- Change table properties form -->
|
||||||
<form method="post" action="tbl_replace.php" name="insertForm" <?php if ($is_upload) echo ' enctype="multipart/form-data"'; ?>>
|
<form method="post" action="tbl_replace.php" name="insertForm" <?php if ($is_upload) { echo ' enctype="multipart/form-data"'; } ?>>
|
||||||
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
||||||
<input type="hidden" name="goto" value="<?php echo urlencode($goto); ?>" />
|
<input type="hidden" name="goto" value="<?php echo urlencode($goto); ?>" />
|
||||||
<input type="hidden" name="pos" value="<?php echo isset($pos) ? $pos : 0; ?>" />
|
<input type="hidden" name="pos" value="<?php echo isset($pos) ? $pos : 0; ?>" />
|
||||||
@@ -361,7 +361,7 @@ foreach ($loop_array AS $vrowcount => $vrow) {
|
|||||||
&& !isset($row_table_def['Default'])
|
&& !isset($row_table_def['Default'])
|
||||||
&& isset($row_table_def['Null'])
|
&& isset($row_table_def['Null'])
|
||||||
&& $row_table_def['Null'] == 'YES') {
|
&& $row_table_def['Null'] == 'YES') {
|
||||||
$row_table_def['Default'] = NULL;
|
$row_table_def['Default'] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($row_table_def['Type'] == 'datetime'
|
if ($row_table_def['Type'] == 'datetime'
|
||||||
@@ -636,8 +636,7 @@ foreach ($loop_array AS $vrowcount => $vrow) {
|
|||||||
</td>
|
</td>
|
||||||
<?php
|
<?php
|
||||||
unset($disp_row);
|
unset($disp_row);
|
||||||
}
|
} elseif ($cfg['LongtextDoubleTextarea'] && strstr($type, 'longtext')) {
|
||||||
else if ($cfg['LongtextDoubleTextarea'] && strstr($type, 'longtext')) {
|
|
||||||
?>
|
?>
|
||||||
<td bgcolor="<?php echo $bgcolor; ?>"> </td>
|
<td bgcolor="<?php echo $bgcolor; ?>"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -648,8 +647,7 @@ foreach ($loop_array AS $vrowcount => $vrow) {
|
|||||||
<?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $jsvkey; ?>')" tabindex="<?php echo ($tabindex + $tabindex_for_value); ?>"><?php echo $special_chars; ?></textarea>
|
<?php echo $chg_evt_handler; ?>="return unNullify('<?php echo urlencode($field); ?>', '<?php echo $jsvkey; ?>')" tabindex="<?php echo ($tabindex + $tabindex_for_value); ?>"><?php echo $special_chars; ?></textarea>
|
||||||
</td>
|
</td>
|
||||||
<?php
|
<?php
|
||||||
}
|
} elseif (strstr($type, 'text')) {
|
||||||
else if (strstr($type, 'text')) {
|
|
||||||
?>
|
?>
|
||||||
<td bgcolor="<?php echo $bgcolor; ?>">
|
<td bgcolor="<?php echo $bgcolor; ?>">
|
||||||
<?php echo $backup_field . "\n"; ?>
|
<?php echo $backup_field . "\n"; ?>
|
||||||
@@ -661,8 +659,7 @@ foreach ($loop_array AS $vrowcount => $vrow) {
|
|||||||
if (strlen($special_chars) > 32000) {
|
if (strlen($special_chars) > 32000) {
|
||||||
echo ' <td bgcolor="' . $bgcolor . '">' . $strTextAreaLength . '</td>' . "\n";
|
echo ' <td bgcolor="' . $bgcolor . '">' . $strTextAreaLength . '</td>' . "\n";
|
||||||
}
|
}
|
||||||
}
|
} elseif ($type == 'enum') {
|
||||||
else if ($type == 'enum') {
|
|
||||||
$enum = PMA_getEnumSetOptions($row_table_def['Type']);
|
$enum = PMA_getEnumSetOptions($row_table_def['Type']);
|
||||||
$enum_cnt = count($enum);
|
$enum_cnt = count($enum);
|
||||||
?>
|
?>
|
||||||
@@ -698,8 +695,7 @@ foreach ($loop_array AS $vrowcount => $vrow) {
|
|||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
<?php
|
<?php
|
||||||
} // end if
|
} else {
|
||||||
else {
|
|
||||||
echo "\n";
|
echo "\n";
|
||||||
for ($j = 0; $j < $enum_cnt; $j++) {
|
for ($j = 0; $j < $enum_cnt; $j++) {
|
||||||
// Removes automatic MySQL escape format
|
// Removes automatic MySQL escape format
|
||||||
@@ -721,8 +717,7 @@ foreach ($loop_array AS $vrowcount => $vrow) {
|
|||||||
</td>
|
</td>
|
||||||
<?php
|
<?php
|
||||||
echo "\n";
|
echo "\n";
|
||||||
}
|
} elseif ($type == 'set') {
|
||||||
else if ($type == 'set') {
|
|
||||||
$set = PMA_getEnumSetOptions($row_table_def['Type']);
|
$set = PMA_getEnumSetOptions($row_table_def['Type']);
|
||||||
|
|
||||||
if (isset($vset)) {
|
if (isset($vset)) {
|
||||||
@@ -855,8 +850,7 @@ foreach ($loop_array AS $vrowcount => $vrow) {
|
|||||||
if ($is_char) {
|
if ($is_char) {
|
||||||
$fieldsize = (($len > 40) ? 40 : $len);
|
$fieldsize = (($len > 40) ? 40 : $len);
|
||||||
$maxlength = $len;
|
$maxlength = $len;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$fieldsize = 20;
|
$fieldsize = 20;
|
||||||
$maxlength = 99;
|
$maxlength = 99;
|
||||||
} // end if... else...
|
} // end if... else...
|
||||||
@@ -948,8 +942,8 @@ if (!empty($disp_message)) {
|
|||||||
<option value="back" <?php echo $selected_after_insert_back; ?>><?php echo $strAfterInsertBack; ?></option>
|
<option value="back" <?php echo $selected_after_insert_back; ?>><?php echo $strAfterInsertBack; ?></option>
|
||||||
<option value="new_insert" <?php echo $selected_after_insert_new_insert; ?>><?php echo $strAfterInsertNewInsert; ?></option>
|
<option value="new_insert" <?php echo $selected_after_insert_new_insert; ?>><?php echo $strAfterInsertNewInsert; ?></option>
|
||||||
<?php
|
<?php
|
||||||
if (isset($primary_key))
|
if (isset($primary_key)) {
|
||||||
{?>
|
?>
|
||||||
<option value="same_insert"><?php echo $strAfterInsertSame; ?></option>
|
<option value="same_insert"><?php echo $strAfterInsertSame; ?></option>
|
||||||
<?php
|
<?php
|
||||||
// If we have just numeric primary key, we can also edit next
|
// If we have just numeric primary key, we can also edit next
|
||||||
|
@@ -36,7 +36,7 @@ if (!defined('PMA_IDX_INCLUDED')) {
|
|||||||
// Not a valid table name -> back to the default db_details sub-page
|
// Not a valid table name -> back to the default db_details sub-page
|
||||||
if ( isset($table) && strlen($table) ) {
|
if ( isset($table) && strlen($table) ) {
|
||||||
$is_table = PMA_DBI_query('SHOW TABLES LIKE \''
|
$is_table = PMA_DBI_query('SHOW TABLES LIKE \''
|
||||||
. PMA_sqlAddslashes($table, TRUE) . '\'', NULL, PMA_DBI_QUERY_STORE);
|
. PMA_sqlAddslashes($table, TRUE) . '\'', null, PMA_DBI_QUERY_STORE);
|
||||||
}
|
}
|
||||||
if ( ! isset($table) || ! strlen($table)
|
if ( ! isset($table) || ! strlen($table)
|
||||||
|| !( $is_table && PMA_DBI_num_rows($is_table) ) ) {
|
|| !( $is_table && PMA_DBI_num_rows($is_table) ) ) {
|
||||||
@@ -343,7 +343,7 @@ else if (!defined('PMA_IDX_INCLUDED')
|
|||||||
<tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
|
<tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
|
||||||
<td><select name="column[]">
|
<td><select name="column[]">
|
||||||
<option value="--ignore--"
|
<option value="--ignore--"
|
||||||
<?php if ('--ignore--' == $selected) echo ' selected="selected"'; ?>>
|
<?php if ('--ignore--' == $selected) { echo ' selected="selected"'; } ?>>
|
||||||
-- <?php echo $strIgnore; ?> --</option>
|
-- <?php echo $strIgnore; ?> --</option>
|
||||||
<?php
|
<?php
|
||||||
foreach ($fields_names AS $key => $val) {
|
foreach ($fields_names AS $key => $val) {
|
||||||
|
@@ -44,7 +44,7 @@ PMA_DBI_select_db($db);
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Multi-tables printview thanks to Christophe Gesch<63> from the "MySQL Form
|
* Multi-tables printview thanks to Christophe Gesch<63> from the "MySQL Form
|
||||||
* Generator for PHPMyAdmin" (http://sourceforge.net/projects/phpmysqlformgen/)
|
* Generator for PHPMyAdmin" (http://sourceforge.net/projects/phpmysqlformgen/)
|
||||||
*/
|
*/
|
||||||
if (isset($selected_tbl) && is_array($selected_tbl)) {
|
if (isset($selected_tbl) && is_array($selected_tbl)) {
|
||||||
@@ -102,7 +102,7 @@ foreach ($the_tables AS $key => $table) {
|
|||||||
/**
|
/**
|
||||||
* Gets fields properties
|
* Gets fields properties
|
||||||
*/
|
*/
|
||||||
$result = PMA_DBI_query('SHOW FIELDS FROM ' . PMA_backquote($table) . ';', NULL, PMA_DBI_QUERY_STORE);
|
$result = PMA_DBI_query('SHOW FIELDS FROM ' . PMA_backquote($table) . ';', null, PMA_DBI_QUERY_STORE);
|
||||||
$fields_cnt = PMA_DBI_num_rows($result);
|
$fields_cnt = PMA_DBI_num_rows($result);
|
||||||
|
|
||||||
// Check if we can use Relations (Mike Beck)
|
// Check if we can use Relations (Mike Beck)
|
||||||
@@ -116,8 +116,7 @@ foreach ($the_tables AS $key => $table) {
|
|||||||
} else {
|
} else {
|
||||||
$have_rel = FALSE;
|
$have_rel = FALSE;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$have_rel = FALSE;
|
$have_rel = FALSE;
|
||||||
} // end if
|
} // end if
|
||||||
|
|
||||||
@@ -220,7 +219,7 @@ foreach ($the_tables AS $key => $table) {
|
|||||||
<td width="80" class="print"<?php echo $type_nowrap; ?>><?php echo $type; ?><bdo dir="ltr"></bdo></td>
|
<td width="80" class="print"<?php echo $type_nowrap; ?>><?php echo $type; ?><bdo dir="ltr"></bdo></td>
|
||||||
<!--<td width="50" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $strAttribute; ?></td>-->
|
<!--<td width="50" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $strAttribute; ?></td>-->
|
||||||
<td width="40" class="print"><?php echo (($row['Null'] == '' || $row['Null'] == 'NO') ? $strNo : $strYes); ?> </td>
|
<td width="40" class="print"><?php echo (($row['Null'] == '' || $row['Null'] == 'NO') ? $strNo : $strYes); ?> </td>
|
||||||
<td width="70" class="print" nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?> </td>
|
<td width="70" class="print" nowrap="nowrap"><?php if (isset($row['Default'])) {7echo $row['Default']; } ?> </td>
|
||||||
<!--<td width="50" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?> </td>-->
|
<!--<td width="50" bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?> </td>-->
|
||||||
<?php
|
<?php
|
||||||
echo "\n";
|
echo "\n";
|
||||||
|
@@ -75,7 +75,7 @@ while ($row = PMA_DBI_fetch_assoc($result)) {
|
|||||||
PMA_DBI_free_result($result);
|
PMA_DBI_free_result($result);
|
||||||
|
|
||||||
// 3. Get fields
|
// 3. Get fields
|
||||||
$fields_rs = PMA_DBI_query('SHOW FULL FIELDS FROM ' . PMA_backquote($table) . ';', NULL, PMA_DBI_QUERY_STORE);
|
$fields_rs = PMA_DBI_query('SHOW FULL FIELDS FROM ' . PMA_backquote($table) . ';', null, PMA_DBI_QUERY_STORE);
|
||||||
$fields_cnt = PMA_DBI_num_rows($fields_rs);
|
$fields_cnt = PMA_DBI_num_rows($fields_rs);
|
||||||
|
|
||||||
// Get more complete field information
|
// Get more complete field information
|
||||||
@@ -362,7 +362,7 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
|
|||||||
<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <td>' . (empty($field_charset) ? '' : '<dfn title="' . PMA_getCollationDescr($field_charset) . '">' . $field_charset . '</dfn>') . '</td>' . "\n" : '' ?>
|
<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <td>' . (empty($field_charset) ? '' : '<dfn title="' . PMA_getCollationDescr($field_charset) . '">' . $field_charset . '</dfn>') . '</td>' . "\n" : '' ?>
|
||||||
<td nowrap="nowrap" style="font-size: 70%"><?php echo $attribute; ?></td>
|
<td nowrap="nowrap" style="font-size: 70%"><?php echo $attribute; ?></td>
|
||||||
<td><?php echo (($row['Null'] == 'YES') ? $strYes : $strNo); ?></td>
|
<td><?php echo (($row['Null'] == 'YES') ? $strYes : $strNo); ?></td>
|
||||||
<td nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?></td>
|
<td nowrap="nowrap"><?php if (isset($row['Default'])) { echo $row['Default']; } ?></td>
|
||||||
<td nowrap="nowrap"><?php echo $row['Extra']; ?></td>
|
<td nowrap="nowrap"><?php echo $row['Extra']; ?></td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<a href="sql.php?<?php echo $url_query; ?>&sql_query=<?php echo urlencode( 'SELECT COUNT(*) AS `' . $strRows . '`, `' . $row['Field'] . '` FROM `' . $table . '` GROUP BY `' . $row['Field'] . '` ORDER BY `' . $row['Field'] . '`' ); ?>">
|
<a href="sql.php?<?php echo $url_query; ?>&sql_query=<?php echo urlencode( 'SELECT COUNT(*) AS `' . $strRows . '`, `' . $row['Field'] . '` FROM `' . $table . '` GROUP BY `' . $row['Field'] . '` ORDER BY `' . $row['Field'] . '`' ); ?>">
|
||||||
@@ -723,11 +723,9 @@ if ( $cfg['ShowStats'] ) {
|
|||||||
<td class="value"><?php
|
<td class="value"><?php
|
||||||
if ($showtable['Row_format'] == 'Fixed') {
|
if ($showtable['Row_format'] == 'Fixed') {
|
||||||
echo $strFixed;
|
echo $strFixed;
|
||||||
}
|
} elseif ($showtable['Row_format'] == 'Dynamic') {
|
||||||
else if ($showtable['Row_format'] == 'Dynamic') {
|
|
||||||
echo $strDynamic;
|
echo $strDynamic;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
echo $showtable['Row_format'];
|
echo $showtable['Row_format'];
|
||||||
}
|
}
|
||||||
?></td>
|
?></td>
|
||||||
|
@@ -39,8 +39,8 @@ $options_array = array('CASCADE' => 'CASCADE', 'SET_NULL' => 'SET NULL', 'NO_ACT
|
|||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function PMA_generate_dropdown($dropdown_question,$radio_name,$choices,$selected_value) {
|
function PMA_generate_dropdown($dropdown_question, $radio_name, $choices, $selected_value)
|
||||||
|
{
|
||||||
echo $dropdown_question . ' ';
|
echo $dropdown_question . ' ';
|
||||||
|
|
||||||
echo '<select name="' . $radio_name . '">' . "\n";
|
echo '<select name="' . $radio_name . '">' . "\n";
|
||||||
@@ -281,7 +281,7 @@ if ($cfgRelation['relwork'] || $tbl_type=='INNODB') {
|
|||||||
}
|
}
|
||||||
// [0] of the row is the name
|
// [0] of the row is the name
|
||||||
|
|
||||||
$tab_rs = PMA_DBI_query($tab_query, NULL, PMA_DBI_QUERY_STORE);
|
$tab_rs = PMA_DBI_query($tab_query, null, PMA_DBI_QUERY_STORE);
|
||||||
$selectboxall['nix'] = '--';
|
$selectboxall['nix'] = '--';
|
||||||
$selectboxall_innodb['nix'] = '--';
|
$selectboxall_innodb['nix'] = '--';
|
||||||
|
|
||||||
@@ -290,7 +290,7 @@ if ($cfgRelation['relwork'] || $tbl_type=='INNODB') {
|
|||||||
PMA_DBI_select_db($db);
|
PMA_DBI_select_db($db);
|
||||||
|
|
||||||
// need to use PMA_DBI_QUERY_STORE with PMA_DBI_num_rows() in mysqli
|
// need to use PMA_DBI_QUERY_STORE with PMA_DBI_num_rows() in mysqli
|
||||||
$fi_rs = PMA_DBI_query('SHOW KEYS FROM ' . PMA_backquote($curr_table[0]) . ';', NULL, PMA_DBI_QUERY_STORE);
|
$fi_rs = PMA_DBI_query('SHOW KEYS FROM ' . PMA_backquote($curr_table[0]) . ';', null, PMA_DBI_QUERY_STORE);
|
||||||
if ($fi_rs && PMA_DBI_num_rows($fi_rs) > 0) {
|
if ($fi_rs && PMA_DBI_num_rows($fi_rs) > 0) {
|
||||||
$seen_a_primary = FALSE;
|
$seen_a_primary = FALSE;
|
||||||
while ($curr_field = PMA_DBI_fetch_assoc($fi_rs)) {
|
while ($curr_field = PMA_DBI_fetch_assoc($fi_rs)) {
|
||||||
@@ -337,7 +337,7 @@ if ($cfgRelation['relwork'] || $tbl_type=='INNODB') {
|
|||||||
PMA_DBI_select_db($db);
|
PMA_DBI_select_db($db);
|
||||||
|
|
||||||
// need to use PMA_DBI_QUERY_STORE with PMA_DBI_num_rows() in mysqli
|
// need to use PMA_DBI_QUERY_STORE with PMA_DBI_num_rows() in mysqli
|
||||||
$fi_rs = PMA_DBI_query('SHOW KEYS FROM ' . PMA_backquote($curr_table[0]) . ';', NULL, PMA_DBI_QUERY_STORE);
|
$fi_rs = PMA_DBI_query('SHOW KEYS FROM ' . PMA_backquote($curr_table[0]) . ';', null, PMA_DBI_QUERY_STORE);
|
||||||
if ($fi_rs && PMA_DBI_num_rows($fi_rs) > 0) {
|
if ($fi_rs && PMA_DBI_num_rows($fi_rs) > 0) {
|
||||||
while ($curr_field = PMA_DBI_fetch_assoc($fi_rs)) {
|
while ($curr_field = PMA_DBI_fetch_assoc($fi_rs)) {
|
||||||
$field_full = $db . '.' . $curr_field['Table'] . '.' . $curr_field['Column_name'];
|
$field_full = $db . '.' . $curr_field['Table'] . '.' . $curr_field['Column_name'];
|
||||||
@@ -358,7 +358,7 @@ if ($cfgRelation['relwork'] || $tbl_type=='INNODB') {
|
|||||||
|
|
||||||
// Now find out the columns of our $table
|
// Now find out the columns of our $table
|
||||||
// need to use PMA_DBI_QUERY_STORE with PMA_DBI_num_rows() in mysqli
|
// need to use PMA_DBI_QUERY_STORE with PMA_DBI_num_rows() in mysqli
|
||||||
$col_rs = PMA_DBI_try_query('SHOW COLUMNS FROM ' . PMA_backquote($table) . ';', NULL, PMA_DBI_QUERY_STORE);
|
$col_rs = PMA_DBI_try_query('SHOW COLUMNS FROM ' . PMA_backquote($table) . ';', null, PMA_DBI_QUERY_STORE);
|
||||||
|
|
||||||
if ($col_rs && PMA_DBI_num_rows($col_rs) > 0) {
|
if ($col_rs && PMA_DBI_num_rows($col_rs) > 0) {
|
||||||
while ($row = PMA_DBI_fetch_assoc($col_rs)) {
|
while ($row = PMA_DBI_fetch_assoc($col_rs)) {
|
||||||
|
@@ -122,7 +122,9 @@ $message = '';
|
|||||||
|
|
||||||
foreach ($loop_array AS $primary_key_index => $enc_primary_key) {
|
foreach ($loop_array AS $primary_key_index => $enc_primary_key) {
|
||||||
// skip fields to be ignored
|
// skip fields to be ignored
|
||||||
if (!$using_key && isset($GLOBALS['insert_ignore_' . $enc_primary_key])) continue;
|
if (!$using_key && isset($GLOBALS['insert_ignore_' . $enc_primary_key])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Restore the "primary key" to a convenient format
|
// Restore the "primary key" to a convenient format
|
||||||
$primary_key = urldecode($enc_primary_key);
|
$primary_key = urldecode($enc_primary_key);
|
||||||
|
@@ -49,7 +49,7 @@ if (!isset($param) || $param[0] == '') {
|
|||||||
$err_url = $goto . '?' . PMA_generate_common_url($db, $table);
|
$err_url = $goto . '?' . PMA_generate_common_url($db, $table);
|
||||||
|
|
||||||
// Gets the list and number of fields
|
// Gets the list and number of fields
|
||||||
$result = PMA_DBI_query('SHOW' . (PMA_MYSQL_INT_VERSION >= 40100 ? ' FULL' : '') . ' FIELDS FROM ' . PMA_backquote($table) . ' FROM ' . PMA_backquote($db) . ';', NULL, PMA_DBI_QUERY_STORE);
|
$result = PMA_DBI_query('SHOW' . (PMA_MYSQL_INT_VERSION >= 40100 ? ' FULL' : '') . ' FIELDS FROM ' . PMA_backquote($table) . ' FROM ' . PMA_backquote($db) . ';', null, PMA_DBI_QUERY_STORE);
|
||||||
$fields_cnt = PMA_DBI_num_rows($result);
|
$fields_cnt = PMA_DBI_num_rows($result);
|
||||||
// rabue: we'd better ensure, that all arrays are empty.
|
// rabue: we'd better ensure, that all arrays are empty.
|
||||||
$fields_list = $fields_null = $fields_type = $fields_collation = array();
|
$fields_list = $fields_null = $fields_type = $fields_collation = array();
|
||||||
|
@@ -22,12 +22,12 @@ require_once('./libraries/db_table_exists.lib.php');
|
|||||||
* Get the list of the fields of the current table
|
* Get the list of the fields of the current table
|
||||||
*/
|
*/
|
||||||
PMA_DBI_select_db($db);
|
PMA_DBI_select_db($db);
|
||||||
$table_def = PMA_DBI_query('SHOW FIELDS FROM ' . PMA_backquote($table), NULL, PMA_DBI_QUERY_STORE);
|
$table_def = PMA_DBI_query('SHOW FIELDS FROM ' . PMA_backquote($table), null, PMA_DBI_QUERY_STORE);
|
||||||
if (isset($primary_key)) {
|
if (isset($primary_key)) {
|
||||||
$result = PMA_DBI_query('SELECT * FROM ' . PMA_backquote($table) . ' WHERE ' . $primary_key . ';', NULL, PMA_DBI_QUERY_STORE);
|
$result = PMA_DBI_query('SELECT * FROM ' . PMA_backquote($table) . ' WHERE ' . $primary_key . ';', null, PMA_DBI_QUERY_STORE);
|
||||||
$row = PMA_DBI_fetch_assoc($result);
|
$row = PMA_DBI_fetch_assoc($result);
|
||||||
} else {
|
} else {
|
||||||
$result = PMA_DBI_query('SELECT * FROM ' . PMA_backquote($table) . ' LIMIT 1;', NULL, PMA_DBI_QUERY_STORE);
|
$result = PMA_DBI_query('SELECT * FROM ' . PMA_backquote($table) . ' LIMIT 1;', null, PMA_DBI_QUERY_STORE);
|
||||||
$row = PMA_DBI_fetch_assoc($result);
|
$row = PMA_DBI_fetch_assoc($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user