You need PHP 5.2.0 or newer, with session support
(see
- FAQ 1.31)
- , the Standard PHP Library (SPL) extension and JSON support.
+ FAQ 1.31)
+ , the Standard PHP Library (SPL) extension and JSON support.
-
To support uploading of ZIP files, you need the PHP zip extension.
+
To support uploading of ZIP files, you need the PHP zip extension.
For proper support of multibyte strings (eg. UTF-8, which is
currently the default), you should install the mbstring and ctype
extensions.
@@ -778,7 +778,7 @@
Configuration
Please see the install section on "Using authentication modes"
for more information.
-
+
$cfg['Servers'][$i]['auth_http_realm'] string
@@ -1244,10 +1244,10 @@
Configuration
$cfg['Servers'][$i]['AllowNoPassword']
boolean
-
Whether to allow logins without a password. The default
- value of false for this parameter prevents unintended access
- to a MySQL server with was left with an empty password for root or
- on which an anonymous (blank) user is defined.
+
Whether to allow logins without a password. The default
+ value of false for this parameter prevents unintended access
+ to a MySQL server with was left with an empty password for root or
+ on which an anonymous (blank) user is defined.
This is needed for native MS Excel export, see
FAQ
- 6.23 and to work around limitations of
- open_basedir for uploaded
+ 6.23 and to work around limitations of
+ open_basedir for uploaded
files, see FAQ
1.11.
- If the directory where phpMyAdmin is installed is subject to an
- open_basedir restriction, you need to create a
+ If the directory where phpMyAdmin is installed is subject to an
+ open_basedir restriction, you need to create a
temporary directory in some directory accessible by the web
server. However for security reasons, this directory should be outside
the tree published by webserver. If you cannot avoid having this
@@ -3106,7 +3106,7 @@
Note: if the backend url looks like http://host/~user/phpmyadmin,
- the tilde (~) must be url encoded as %7E in the ProxyPassReverse* lines.
- This is not specific to phpmyadmin, it's just the behavior of Apache.
-
+ the tilde (~) must be url encoded as %7E in the ProxyPassReverse* lines.
+ This is not specific to phpmyadmin, it's just the behavior of Apache.
+
For general information about BLOB streaming on MySQL, visit blobstreaming.org. You need the following components:
@@ -4309,11 +4309,11 @@
Here are details about configuration and operation:
-
In config.inc.php your host should be defined with a FQDN (fully qualified domain name) instead of "localhost".
+
In config.inc.php your host should be defined with a FQDN (fully qualified domain name) instead of "localhost".
Ensure that your target table is under the PBXT storage engine and has a LONGBLOB column (which must be nullable if you want to remove the BLOB reference from it).
-
When you insert or update a row in this table, put a checkmark on the "Upload to BLOB repository" optional choice; otherwise, the upload will be done directly in your LONGBLOB column instead of the repository.
-
Finally when you browse your table, you'll see in your column a link to stream your data, for example "View image". A header containing the correct MIME-type will be sent to your browser; this MIME-type was stored at upload time.
-
+
When you insert or update a row in this table, put a checkmark on the "Upload to BLOB repository" optional choice; otherwise, the upload will be done directly in your LONGBLOB column instead of the repository.
+
Finally when you browse your table, you'll see in your column a link to stream your data, for example "View image". A header containing the correct MIME-type will be sent to your browser; this MIME-type was stored at upload time.
';
}
@@ -113,10 +113,10 @@
* explode
* count
* strlen
- * @param string the table name
- * @param string restrict the search to this field
- * @param string the string to search
- * @param integer type of search (1 -> 1 word at least, 2 -> all words,
+ * @param string the table name
+ * @param string restrict the search to this field
+ * @param string the string to search
+ * @param integer type of search (1 -> 1 word at least, 2 -> all words,
* 3 -> exact string, 4 -> regexp)
*
* @return array 3 SQL querys (for count, display and delete results)
@@ -262,7 +262,7 @@ function PMA_getSearchSqls($table, $field, $search_str, $search_option)
/**
* If we are in an Ajax request, we need to exit after displaying all the HTML
*/
-if($GLOBALS['is_ajax_request'] == true) {
+if ($GLOBALS['is_ajax_request'] == true) {
exit;
}
else {
diff --git a/db_structure.php b/db_structure.php
index 6a2391e28769..160e9da8dfa8 100644
--- a/db_structure.php
+++ b/db_structure.php
@@ -62,17 +62,17 @@
// 1. No tables
if ($num_tables == 0) {
- echo '
' . __('No tables found in database') . '
' . "\n";
+ echo '
' . __('No tables found in database') . '
' . "\n";
- if (empty($db_is_information_schema)) {
- require './libraries/display_create_table.lib.php';
- } // end if (Create Table dialog)
+ if (empty($db_is_information_schema)) {
+ require './libraries/display_create_table.lib.php';
+ } // end if (Create Table dialog)
- /**
- * Displays the footer
- */
- require_once './libraries/footer.inc.php';
- exit;
+ /**
+ * Displays the footer
+ */
+ require_once './libraries/footer.inc.php';
+ exit;
}
// else
@@ -183,7 +183,7 @@
}
//$display_rows = ' - ';
break;
- // Mysql 5.0.x (and lower) uses MRG_MyISAM and MySQL 5.1.x (and higher) uses MRG_MYISAM
+ // Mysql 5.0.x (and lower) uses MRG_MyISAM and MySQL 5.1.x (and higher) uses MRG_MYISAM
// Both are aliases for MERGE
case 'MRG_MyISAM' :
case 'MRG_MYISAM' :
@@ -384,7 +384,7 @@
$sum_row_count_pre = '~';
$show_superscript = PMA_showHint(PMA_sanitize(sprintf(__('This view has at least this number of rows. Please refer to %sdocumentation%s.'), '[a@./Documentation.html#cfg_MaxExactCountViews@_blank]', '[/a]')));
}
- } elseif($each_table['ENGINE'] == 'InnoDB' && (! $each_table['COUNTED'])) {
+ } elseif ($each_table['ENGINE'] == 'InnoDB' && (! $each_table['COUNTED'])) {
// InnoDB table: we did not get an accurate row count
$row_count_pre = '~';
$sum_row_count_pre = '~';
diff --git a/db_tracking.php b/db_tracking.php
index 38a231d4e0a3..df1106e83b1c 100644
--- a/db_tracking.php
+++ b/db_tracking.php
@@ -16,7 +16,7 @@
/**
* If we are not in an Ajax request, then do the common work and show the links etc.
*/
-if($GLOBALS['is_ajax_request'] != true) {
+if ($GLOBALS['is_ajax_request'] != true) {
require './libraries/db_common.inc.php';
}
$url_query .= '&goto=tbl_tracking.php&back=db_tracking.php';
@@ -34,7 +34,7 @@
* If in an Ajax request, generate the success message and use
* {@link PMA_ajaxResponse()} to send the output
*/
- if($GLOBALS['is_ajax_request'] == true) {
+ if ($GLOBALS['is_ajax_request'] == true) {
$message = PMA_Message::success();
PMA_ajaxResponse($message, true);
}
diff --git a/docs.css b/docs.css
index 96574d9c66f8..7e1553741994 100644
--- a/docs.css
+++ b/docs.css
@@ -18,8 +18,8 @@ img {
#header {
margin: 0px;
padding: 1em 0.5em 0.5em 1em;
- background: #036;
- border: 0px;
+ background: #036;
+ border: 0px;
border-bottom: 1px solid black;
}
@@ -31,16 +31,16 @@ img {
}
#header h1 a {
- color: #7584b3;
+ color: #7584b3;
}
#header h1 a .myadmin {
- color: #ffad17;
+ color: #ffad17;
}
#body {
- margin: 2em 1em 1em 1em;
- padding: 0px;
+ margin: 2em 1em 1em 1em;
+ padding: 0px;
padding-right: 13em;
}
@@ -54,13 +54,13 @@ ul#footer {
font-size: smaller;
list-style: none;
float: left;
- padding: 1em;
+ padding: 1em;
color: gray;
border: none;
}
#footer a {
- color: #c19e66;
+ color: #c19e66;
}
abbr, acronym {
@@ -73,12 +73,12 @@ abbr, acronym {
a {
text-decoration: none;
- color: #c17d11;
+ color: #c17d11;
}
a:hover {
- text-decoration: underline;
- color: #8f5902;
+ text-decoration: underline;
+ color: #8f5902;
}
sup {
@@ -128,22 +128,22 @@ ul.header a:hover {
}
h2 {
- color: #727e0a;
+ color: #727e0a;
max-width: 70em;
}
h3 {
- color: #727e0a;
+ color: #727e0a;
max-width: 70em;
}
h4, h5 {
- color: #727e0a;
+ color: #727e0a;
max-width: 70em;
}
h4 a {
- color: #727e0a;
+ color: #727e0a;
}
p {
diff --git a/enum_editor.php b/enum_editor.php
index 5fe962fc10a8..9287bb3febcb 100644
--- a/enum_editor.php
+++ b/enum_editor.php
@@ -33,7 +33,7 @@
// Display the values in text fields, excluding empty strings
$field_counter = 0;
foreach ($values as $value) {
- if(trim($value) != "") {
+ if (trim($value) != "") {
$field_counter++;
echo sprintf('', htmlspecialchars(str_replace(array("''", '\\\\', "\\'"), array("'", '\\', "'"), substr($value, 1, -1))));
}
@@ -41,7 +41,7 @@
$total_fields = $field_counter;
// If extra empty fields are added, display them
- if(isset($_GET['extra_fields'])) {
+ if (isset($_GET['extra_fields'])) {
$total_fields += $_GET['extra_fields'];
for($i = $field_counter+1; $i <= $total_fields; $i++) {
echo '';
diff --git a/export.php b/export.php
index f5a985ac75af..d7c2f87e9705 100644
--- a/export.php
+++ b/export.php
@@ -1,7 +1,7 @@
$export_type, 'single_table' => isset($single_table)));
+$export_list = PMA_getPlugins(
+ './libraries/export/',
+ array(
+ 'export_type' => $export_type,
+ 'single_table' => isset($single_table)));
// Backward compatbility
$type = $what;
@@ -43,7 +47,7 @@
$buffer_needed = false;
// Is it a quick or custom export?
-if($_REQUEST['quick_or_custom'] == 'quick') {
+if ($_REQUEST['quick_or_custom'] == 'quick') {
$quick_export = true;
} else {
$quick_export = false;
@@ -58,7 +62,7 @@
$buffer_needed = true;
}
if (($quick_export && !empty($_REQUEST['quick_export_onserver'])) || (!$quick_export && !empty($_REQUEST['onserver']))) {
- if($quick_export) {
+ if ($quick_export) {
$onserver = $_REQUEST['quick_export_onserver'];
} else {
$onserver = $_REQUEST['onserver'];
@@ -125,7 +129,7 @@
* Output handler for all exports, if needed buffering, it stores data into
* $dump_buffer, otherwise it prints thems out.
*
- * @param string $line the insert statement
+ * @param string $line the insert statement
* @return bool Whether output suceeded
*/
function PMA_exportOutputHandler($line)
@@ -279,7 +283,7 @@ function PMA_exportOutputHandler($line)
$extension_start_pos = strlen($filename) - strlen($export_list[$type]['extension']) - 1;
$user_extension = substr($filename, $extension_start_pos, strlen($filename));
$required_extension = "." . $export_list[$type]['extension'];
- if(strtolower($user_extension) != $required_extension) {
+ if (strtolower($user_extension) != $required_extension) {
$filename .= $required_extension;
}
$mime_type = $export_list[$type]['mime_type'];
@@ -394,9 +398,9 @@ function PMA_exportOutputHandler($line)
}
// Convert the multiple select elements from an array to a string
- if($export_type == 'server' && isset($_REQUEST['db_select'])) {
+ if ($export_type == 'server' && isset($_REQUEST['db_select'])) {
$_REQUEST['db_select'] = implode(",", $_REQUEST['db_select']);
- } elseif($export_type == 'database' && isset($_REQUEST['table_select'])) {
+ } elseif ($export_type == 'database' && isset($_REQUEST['table_select'])) {
$_REQUEST['table_select'] = implode(",", $_REQUEST['table_select']);
}
@@ -419,123 +423,182 @@ function PMA_exportOutputHandler($line)
// need exceptions here :-)
do {
-// Add possibly some comments to export
-if (!PMA_exportHeader()) {
- break;
-}
-
-// Will we need relation & co. setup?
-$do_relation = isset($GLOBALS[$what . '_relation']);
-$do_comments = isset($GLOBALS[$what . '_include_comments']);
-$do_mime = isset($GLOBALS[$what . '_mime']);
-if ($do_relation || $do_comments || $do_mime) {
- $cfgRelation = PMA_getRelationsParam();
-}
-if ($do_mime) {
- require_once './libraries/transformations.lib.php';
-}
-
-// Include dates in export?
-$do_dates = isset($GLOBALS[$what . '_dates']);
+ // Add possibly some comments to export
+ if (!PMA_exportHeader()) {
+ break;
+ }
-/**
- * Builds the dump
- */
-// Gets the number of tables if a dump of a database has been required
-if ($export_type == 'server') {
- if (isset($db_select)) {
- $tmp_select = implode($db_select, '|');
- $tmp_select = '|' . $tmp_select . '|';
+ // Will we need relation & co. setup?
+ $do_relation = isset($GLOBALS[$what . '_relation']);
+ $do_comments = isset($GLOBALS[$what . '_include_comments']);
+ $do_mime = isset($GLOBALS[$what . '_mime']);
+ if ($do_relation || $do_comments || $do_mime) {
+ $cfgRelation = PMA_getRelationsParam();
}
- // Walk over databases
- foreach ($GLOBALS['pma']->databases as $current_db) {
- if ((isset($tmp_select) && strpos(' ' . $tmp_select, '|' . $current_db . '|'))
- || ! isset($tmp_select)) {
- if (!PMA_exportDBHeader($current_db)) {
- break 2;
- }
- if (!PMA_exportDBCreate($current_db)) {
- break 2;
- }
- if (function_exists('PMA_exportRoutines') && strpos($GLOBALS['sql_structure_or_data'], 'structure') !== false && isset($GLOBALS['sql_procedure_function'])) {
- PMA_exportRoutines($current_db);
- }
+ if ($do_mime) {
+ require_once './libraries/transformations.lib.php';
+ }
+
+ // Include dates in export?
+ $do_dates = isset($GLOBALS[$what . '_dates']);
- $tables = PMA_DBI_get_tables($current_db);
- $views = array();
- foreach ($tables as $table) {
- // if this is a view, collect it for later; views must be exported
- // after the tables
- $is_view = PMA_Table::isView($current_db, $table);
- if ($is_view) {
- $views[] = $table;
+ /**
+ * Builds the dump
+ */
+ // Gets the number of tables if a dump of a database has been required
+ if ($export_type == 'server') {
+ if (isset($db_select)) {
+ $tmp_select = implode($db_select, '|');
+ $tmp_select = '|' . $tmp_select . '|';
+ }
+ // Walk over databases
+ foreach ($GLOBALS['pma']->databases as $current_db) {
+ if ((isset($tmp_select) && strpos(' ' . $tmp_select, '|' . $current_db . '|'))
+ || ! isset($tmp_select)) {
+ if (!PMA_exportDBHeader($current_db)) {
+ break 2;
}
- if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
- // for a view, export a stand-in definition of the table
- // to resolve view dependencies
- if (!PMA_exportStructure($current_db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'stand_in' : 'create_table', $export_type)) {
- break 3;
- }
+ if (!PMA_exportDBCreate($current_db)) {
+ break 2;
}
- // if this is a view or a merge table, don't export data
- if (($GLOBALS[$what . '_structure_or_data'] == 'data' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') && !($is_view || PMA_Table::isMerge($current_db, $table))) {
- $local_query = 'SELECT * FROM ' . PMA_backquote($current_db) . '.' . PMA_backquote($table);
- if (!PMA_exportData($current_db, $table, $crlf, $err_url, $local_query)) {
- break 3;
+ if (function_exists('PMA_exportRoutines') && strpos($GLOBALS['sql_structure_or_data'], 'structure') !== false && isset($GLOBALS['sql_procedure_function'])) {
+ PMA_exportRoutines($current_db);
+ }
+
+ $tables = PMA_DBI_get_tables($current_db);
+ $views = array();
+ foreach ($tables as $table) {
+ // if this is a view, collect it for later; views must be exported
+ // after the tables
+ $is_view = PMA_Table::isView($current_db, $table);
+ if ($is_view) {
+ $views[] = $table;
+ }
+ if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
+ // for a view, export a stand-in definition of the table
+ // to resolve view dependencies
+ if (!PMA_exportStructure($current_db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'stand_in' : 'create_table', $export_type)) {
+ break 3;
+ }
+ }
+ // if this is a view or a merge table, don't export data
+ if (($GLOBALS[$what . '_structure_or_data'] == 'data' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') && !($is_view || PMA_Table::isMerge($current_db, $table))) {
+ $local_query = 'SELECT * FROM ' . PMA_backquote($current_db) . '.' . PMA_backquote($table);
+ if (!PMA_exportData($current_db, $table, $crlf, $err_url, $local_query)) {
+ break 3;
+ }
+ }
+ // now export the triggers (needs to be done after the data because
+ // triggers can modify already imported tables)
+ if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
+ if (!PMA_exportStructure($current_db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'triggers', $export_type)) {
+ break 2;
+ }
}
}
- // now export the triggers (needs to be done after the data because
- // triggers can modify already imported tables)
- if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
- if (!PMA_exportStructure($current_db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'triggers', $export_type)) {
- break 2;
+ foreach ($views as $view) {
+ // no data export for a view
+ if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
+ if (!PMA_exportStructure($current_db, $view, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'create_view', $export_type)) {
+ break 3;
+ }
}
}
+ if (!PMA_exportDBFooter($current_db)) {
+ break 2;
+ }
}
- foreach ($views as $view) {
- // no data export for a view
- if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
- if (!PMA_exportStructure($current_db, $view, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'create_view', $export_type)) {
- break 3;
- }
+ }
+ } elseif ($export_type == 'database') {
+ if (!PMA_exportDBHeader($db)) {
+ break;
+ }
+
+ if (function_exists('PMA_exportRoutines') && strpos($GLOBALS['sql_structure_or_data'], 'structure') !== false && isset($GLOBALS['sql_procedure_function'])) {
+ PMA_exportRoutines($db);
+ }
+
+ $i = 0;
+ $views = array();
+ // $tables contains the choices from the user (via $table_select)
+ foreach ($tables as $table) {
+ // if this is a view, collect it for later; views must be exported after
+ // the tables
+ $is_view = PMA_Table::isView($db, $table);
+ if ($is_view) {
+ $views[] = $table;
+ }
+ if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
+ // for a view, export a stand-in definition of the table
+ // to resolve view dependencies
+ if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'stand_in' : 'create_table', $export_type)) {
+ break 2;
}
}
- if (!PMA_exportDBFooter($current_db)) {
- break 2;
+ // if this is a view or a merge table, don't export data
+ if (($GLOBALS[$what . '_structure_or_data'] == 'data' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') && !($is_view || PMA_Table::isMerge($db, $table))) {
+ $local_query = 'SELECT * FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table);
+ if (!PMA_exportData($db, $table, $crlf, $err_url, $local_query)) {
+ break 2;
+ }
+ }
+ // now export the triggers (needs to be done after the data because
+ // triggers can modify already imported tables)
+ if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
+ if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'triggers', $export_type)) {
+ break 2;
+ }
+ }
+ }
+ foreach ($views as $view) {
+ // no data export for a view
+ if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
+ if (!PMA_exportStructure($db, $view, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'create_view', $export_type)) {
+ break 2;
+ }
}
}
- }
-} elseif ($export_type == 'database') {
- if (!PMA_exportDBHeader($db)) {
- break;
- }
- if (function_exists('PMA_exportRoutines') && strpos($GLOBALS['sql_structure_or_data'], 'structure') !== false && isset($GLOBALS['sql_procedure_function'])) {
- PMA_exportRoutines($db);
- }
+ if (!PMA_exportDBFooter($db)) {
+ break;
+ }
+ } else {
+ if (!PMA_exportDBHeader($db)) {
+ break;
+ }
+ // We export just one table
+ // $allrows comes from the form when "Dump all rows" has been selected
+ if ($allrows == '0' && $limit_to > 0 && $limit_from >= 0) {
+ $add_query = ' LIMIT '
+ . (($limit_from > 0) ? $limit_from . ', ' : '')
+ . $limit_to;
+ } else {
+ $add_query = '';
+ }
- $i = 0;
- $views = array();
- // $tables contains the choices from the user (via $table_select)
- foreach ($tables as $table) {
- // if this is a view, collect it for later; views must be exported after
- // the tables
$is_view = PMA_Table::isView($db, $table);
- if ($is_view) {
- $views[] = $table;
- }
if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
- // for a view, export a stand-in definition of the table
- // to resolve view dependencies
- if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'stand_in' : 'create_table', $export_type)) {
- break 2;
+ if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'create_view' : 'create_table', $export_type)) {
+ break;
}
}
- // if this is a view or a merge table, don't export data
- if (($GLOBALS[$what . '_structure_or_data'] == 'data' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') && !($is_view || PMA_Table::isMerge($db, $table))) {
- $local_query = 'SELECT * FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table);
+ // If this is an export of a single view, we have to export data;
+ // for example, a PDF report
+ // if it is a merge table, no data is exported
+ if (($GLOBALS[$what . '_structure_or_data'] == 'data' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') && ! PMA_Table::isMerge($db, $table)) {
+ if (!empty($sql_query)) {
+ // only preg_replace if needed
+ if (!empty($add_query)) {
+ // remove trailing semicolon before adding a LIMIT
+ $sql_query = preg_replace('%;\s*$%', '', $sql_query);
+ }
+ $local_query = $sql_query . $add_query;
+ PMA_DBI_select_db($db);
+ } else {
+ $local_query = 'SELECT * FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table) . $add_query;
+ }
if (!PMA_exportData($db, $table, $crlf, $err_url, $local_query)) {
- break 2;
+ break;
}
}
// now export the triggers (needs to be done after the data because
@@ -545,72 +608,13 @@ function PMA_exportOutputHandler($line)
break 2;
}
}
- }
- foreach ($views as $view) {
- // no data export for a view
- if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
- if (!PMA_exportStructure($db, $view, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'create_view', $export_type)) {
- break 2;
- }
- }
- }
-
- if (!PMA_exportDBFooter($db)) {
- break;
- }
-} else {
- if (!PMA_exportDBHeader($db)) {
- break;
- }
- // We export just one table
- // $allrows comes from the form when "Dump all rows" has been selected
- if ($allrows == '0' && $limit_to > 0 && $limit_from >= 0) {
- $add_query = ' LIMIT '
- . (($limit_from > 0) ? $limit_from . ', ' : '')
- . $limit_to;
- } else {
- $add_query = '';
- }
-
- $is_view = PMA_Table::isView($db, $table);
- if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
- if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'create_view' : 'create_table', $export_type)) {
+ if (!PMA_exportDBFooter($db)) {
break;
}
}
- // If this is an export of a single view, we have to export data;
- // for example, a PDF report
- // if it is a merge table, no data is exported
- if (($GLOBALS[$what . '_structure_or_data'] == 'data' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') && ! PMA_Table::isMerge($db, $table)) {
- if (!empty($sql_query)) {
- // only preg_replace if needed
- if (!empty($add_query)) {
- // remove trailing semicolon before adding a LIMIT
- $sql_query = preg_replace('%;\s*$%', '', $sql_query);
- }
- $local_query = $sql_query . $add_query;
- PMA_DBI_select_db($db);
- } else {
- $local_query = 'SELECT * FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table) . $add_query;
- }
- if (!PMA_exportData($db, $table, $crlf, $err_url, $local_query)) {
- break;
- }
- }
- // now export the triggers (needs to be done after the data because
- // triggers can modify already imported tables)
- if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') {
- if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'triggers', $export_type)) {
- break 2;
- }
- }
- if (!PMA_exportDBFooter($db)) {
+ if (!PMA_exportFooter()) {
break;
}
-}
-if (!PMA_exportFooter()) {
- break;
-}
} while (false);
// End of fake loop
diff --git a/import_status.php b/import_status.php
index d739009ee9b3..7c77e31f86a4 100644
--- a/import_status.php
+++ b/import_status.php
@@ -18,7 +18,7 @@
header('Content-type: text/html');
// wait 0.3 sec before we check for $_SESSION variable, which is set inside import.php
- usleep(300000);
+ usleep(300000);
// wait until message is available
while ($_SESSION['Import_message']['message'] == null) {
@@ -27,7 +27,7 @@
echo $_SESSION['Import_message']['message'];
echo ''."\n";
} else {
diff --git a/js/db_structure.js b/js/db_structure.js
index efc8f2ad2d54..559819e11c9a 100644
--- a/js/db_structure.js
+++ b/js/db_structure.js
@@ -69,8 +69,8 @@ $(document).ready(function() {
if ($("#insert_table_dialog").length > 0) {
$("#insert_table_dialog").remove();
}
- var $div = $('');
- var target = "tbl_change.php";
+ var $div = $('');
+ var target = "tbl_change.php";
/**
* @var button_options Object that stores the options passed to jQueryUI
diff --git a/js/functions.js b/js/functions.js
index dbb962d32ea6..1e2cced85cee 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -28,7 +28,7 @@ var codemirror_editor = false;
* @var chart_activeTimeouts object active timeouts that refresh the charts. When disabling a realtime chart, this can be used to stop the continuous ajax requests
*/
var chart_activeTimeouts = new Object();
-
+
/**
* Add a hidden field to the form to indicate that this will be an
@@ -140,8 +140,8 @@ function PMA_addDatepicker($this_element, options) {
if ($this_element.is('.datetimefield')) {
showTimeOption = true;
}
-
- var defaultOptions = {
+
+ var defaultOptions = {
showOn: 'button',
buttonImage: themeCalendarImage, // defined in js/messages.php
buttonImageOnly: true,
@@ -159,11 +159,11 @@ function PMA_addDatepicker($this_element, options) {
// Fix wrong timepicker z-index, doesn't work without timeout
setTimeout(function() {
- $('#ui-timepicker-div').css('z-index',$('#ui-datepicker-div').css('z-index'))
+ $('#ui-timepicker-div').css('z-index',$('#ui-datepicker-div').css('z-index'))
},0);
},
constrainInput: false
- };
+ };
$this_element.datepicker($.extend(defaultOptions, options));
}
@@ -630,13 +630,13 @@ $(document).ready(function() {
return;
}
var $tr = $(this);
-
+
// make the table unselectable (to prevent default highlighting when shift+click)
$tr.parents('table').noSelect();
-
+
if (!e.shiftKey || last_clicked_row == -1) {
// usual click
-
+
// XXX: FF fires two click events for
yourself
* after the sliding section.
*
- * @param string $id the id of the
on which to apply the effect
- * @param string $message the message to show as a link
+ * @param string $id the id of the
on which to apply the effect
+ * @param string $message the message to show as a link
*/
function PMA_generate_slider_effect($id, $message)
{
@@ -2394,10 +2394,10 @@ function PMA_generate_slider_effect($id, $message)
/**
* Creates an AJAX sliding toggle button (or and equivalent form when AJAX is disabled)
*
- * @param string $action The URL for the request to be executed
- * @param string $select_name The name for the dropdown box
- * @param array $options An array of options (see rte_footer.lib.php)
- * @param string $callback A JS snippet to execute when the request is
+ * @param string $action The URL for the request to be executed
+ * @param string $select_name The name for the dropdown box
+ * @param array $options An array of options (see rte_footer.lib.php)
+ * @param string $callback A JS snippet to execute when the request is
* successfully processed
*
* @return string HTML code for the toggle button
@@ -2548,8 +2548,8 @@ function PMA_cacheUnset($var, $server = 0)
* in MySQL a BIT field can be from 1 to 64 bits so we need this
* function because in PHP, decbin() supports only 32 bits
*
- * @param numeric $value coming from a BIT field
- * @param integer $length
+ * @param numeric $value coming from a BIT field
+ * @param integer $length
* @return string the printable value
*/
function PMA_printable_bit_value($value, $length) {
@@ -2564,7 +2564,7 @@ function PMA_printable_bit_value($value, $length) {
/**
* Verifies whether the value contains a non-printable character
*
- * @param string $value
+ * @param string $value
* @return boolean
*/
function PMA_contains_nonprintable_ascii($value) {
@@ -2575,7 +2575,7 @@ function PMA_contains_nonprintable_ascii($value) {
* Converts a BIT type default value
* for example, b'010' becomes 010
*
- * @param string $bit_default_value
+ * @param string $bit_default_value
* @return string the converted value
*/
function PMA_convert_bit_default_value($bit_default_value) {
@@ -2585,7 +2585,7 @@ function PMA_convert_bit_default_value($bit_default_value) {
/**
* Extracts the various parts from a field type spec
*
- * @param string $fieldspec
+ * @param string $fieldspec
* @return array associative array containing type, spec_in_brackets
* and possibly enum_set_values (another array)
*/
@@ -2661,7 +2661,7 @@ function PMA_extractFieldSpec($fieldspec) {
/**
* Verifies if this table's engine supports foreign keys
*
- * @param string $engine
+ * @param string $engine
* @return boolean
*/
function PMA_foreignkey_supported($engine) {
@@ -2676,7 +2676,7 @@ function PMA_foreignkey_supported($engine) {
/**
* Replaces some characters by a displayable equivalent
*
- * @param string $content
+ * @param string $content
* @return string the content with characters replaced
*/
function PMA_replace_binary_contents($content) {
@@ -2697,7 +2697,7 @@ function PMA_replace_binary_contents($content) {
function PMA_duplicateFirstNewline($string) {
$first_occurence = strpos($string, "\r\n");
- if ($first_occurence === 0){
+ if ($first_occurence === 0) {
$string = "\n".$string;
}
return $string;
@@ -2803,15 +2803,15 @@ function PMA_expandUserString($string, $escape = null, $updates = array()) {
* function that generates a json output for an ajax request and ends script
* execution
*
- * @param bool $message message string containing the html of the message
- * @param bool $success success whether the ajax request was successfull
- * @param array $extra_data extra_data optional - any other data as part of the json request
+ * @param bool $message message string containing the html of the message
+ * @param bool $success success whether the ajax request was successfull
+ * @param array $extra_data extra_data optional - any other data as part of the json request
*
*/
function PMA_ajaxResponse($message, $success = true, $extra_data = array())
{
$response = array();
- if( $success == true ) {
+ if ( $success == true ) {
$response['success'] = true;
if ($message instanceof PMA_Message) {
$response['message'] = $message->getDisplay();
@@ -2822,7 +2822,7 @@ function PMA_ajaxResponse($message, $success = true, $extra_data = array())
}
else {
$response['success'] = false;
- if($message instanceof PMA_Message) {
+ if ($message instanceof PMA_Message) {
$response['error'] = $message->getDisplay();
}
else {
@@ -2831,7 +2831,7 @@ function PMA_ajaxResponse($message, $success = true, $extra_data = array())
}
// If extra_data has been provided, append it to the response array
- if( ! empty($extra_data) && count($extra_data) > 0 ) {
+ if ( ! empty($extra_data) && count($extra_data) > 0 ) {
$response = array_merge($response, $extra_data);
}
@@ -2846,7 +2846,7 @@ function PMA_ajaxResponse($message, $success = true, $extra_data = array())
echo json_encode($response);
- if(!defined('TESTSUITE'))
+ if (!defined('TESTSUITE'))
exit;
}
@@ -2929,8 +2929,8 @@ function PMA_buildActionTitles() {
* $cfg['ColumnTypes'] and either returns an array (useful for quickly checking
* if a datatype is supported) or an HTML snippet that creates a drop-down list.
*
- * @param bool $html Whether to generate an html snippet or an array
- * @param string $selected The value to mark as selected in HTML mode
+ * @param bool $html Whether to generate an html snippet or an array
+ * @param string $selected The value to mark as selected in HTML mode
*
* @return mixed An HTML snippet or an array of datatypes.
*
@@ -3012,9 +3012,9 @@ function PMA_unsupportedDatatypes() {
/**
* Creates a dropdown box with MySQL functions for a particular column.
*
- * @param array $field Data about the column for which
+ * @param array $field Data about the column for which
* to generate the dropdown
- * @param bool $insert_mode Whether the operation is 'insert'
+ * @param bool $insert_mode Whether the operation is 'insert'
*
* @global array $cfg PMA configuration
* @global array $analyzed_sql Analyzed SQL query
@@ -3070,7 +3070,7 @@ function PMA_getFunctionsForField($field, $insert_mode)
// Create the output
$retval = ' ' . "\n";
// loop on the dropdown array and print all available options for that field.
- foreach ($dropdown as $each_dropdown){
+ foreach ($dropdown as $each_dropdown) {
$retval .= ' ';
$retval .= '