diff --git a/ChangeLog b/ChangeLog index e6991b539..35fe23eb2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA AllowEmptyRoot + rfe #1778908 [auth] arbitrary server auth can now also accept port - patch #2089240 [export] handle correctly switching SQL modes ++ rfe #1612724 [export] add option to export without comments 3.0.0.0 (not yet released) + [export] properly handle line breaks for YAML, thanks to Dan Barry - diff --git a/libraries/config.default.php b/libraries/config.default.php index 0a8f7b2a5..28a139d55 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -1366,6 +1366,13 @@ $cfg['Export']['sql_data'] = true; */ $cfg['Export']['sql_compatibility'] = 'NONE'; +/** + * Whether to include comments in SQL export. + * + * @global string $cfg['Export']['sql_compatibility'] + */ +$cfg['Export']['sql_include_comments'] = true; + /** * * diff --git a/libraries/export/sql.php b/libraries/export/sql.php index a58fcd12b..0780db202 100644 --- a/libraries/export/sql.php +++ b/libraries/export/sql.php @@ -26,6 +26,7 @@ if (isset($plugin_list)) { 'mime_type' => 'text/x-sql', 'options' => array( array('type' => 'text', 'name' => 'header_comment', 'text' => 'strAddHeaderComment'), + array('type' => 'bool', 'name' => 'include_comments', 'text' => 'strComments'), array('type' => 'bool', 'name' => 'use_transaction', 'text' => 'strEncloseInTransaction'), array('type' => 'bool', 'name' => 'disable_fk', 'text' => 'strDisableForeignChecks'), ), @@ -137,8 +138,12 @@ if (! isset($sql_backquotes)) { */ function PMA_exportComment($text = '') { - // see http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-comments.html - return '--' . (empty($text) ? '' : ' ') . $text . $GLOBALS['crlf']; + if ($GLOBALS['sql_include_comments']) { + // see http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-comments.html + return '--' . (empty($text) ? '' : ' ') . $text . $GLOBALS['crlf']; + } else { + return ''; + } } /**