rfe #1612724 [export] add option to export without comments

This commit is contained in:
Michal Čihař
2008-09-03 16:08:14 +00:00
parent 742d4d4ed9
commit 04570f5eb7
3 changed files with 15 additions and 2 deletions

View File

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

View File

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

View File

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