Merge branch 'QA_4_5'
This commit is contained in:
commit
1f7b0903f8
@ -603,7 +603,7 @@ function PMA_exportDatabase(
|
||||
if (! $export_plugin->exportDBHeader($db, $db_alias)) {
|
||||
return;
|
||||
}
|
||||
if (! $export_plugin->exportDBCreate($db, $db_alias)) {
|
||||
if (! $export_plugin->exportDBCreate($db, $export_type, $db_alias)) {
|
||||
return;
|
||||
}
|
||||
if ($separate_files == 'database') {
|
||||
|
||||
@ -68,12 +68,13 @@ abstract class ExportPlugin
|
||||
/**
|
||||
* Outputs CREATE DATABASE statement
|
||||
*
|
||||
* @param string $db Database name
|
||||
* @param string $db_alias Aliases of db
|
||||
* @param string $db Database name
|
||||
* @param string $export_type 'server', 'database', 'table'
|
||||
* @param string $db_alias Aliases of db
|
||||
*
|
||||
* @return bool Whether it succeeded
|
||||
*/
|
||||
abstract public function exportDBCreate($db, $db_alias = '');
|
||||
abstract public function exportDBCreate($db, $export_type, $db_alias = '');
|
||||
|
||||
/**
|
||||
* Outputs the content of a table
|
||||
|
||||
@ -163,12 +163,13 @@ class ExportCodegen extends ExportPlugin
|
||||
/**
|
||||
* Outputs CREATE DATABASE statement
|
||||
*
|
||||
* @param string $db Database name
|
||||
* @param string $db_alias Aliases of db
|
||||
* @param string $db Database name
|
||||
* @param string $export_type 'server', 'database', 'table'
|
||||
* @param string $db_alias Aliases of db
|
||||
*
|
||||
* @return bool Whether it succeeded
|
||||
*/
|
||||
public function exportDBCreate($db, $db_alias = '')
|
||||
public function exportDBCreate($db, $export_type, $db_alias = '')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -184,12 +184,13 @@ class ExportCsv extends ExportPlugin
|
||||
/**
|
||||
* Outputs CREATE DATABASE statement
|
||||
*
|
||||
* @param string $db Database name
|
||||
* @param string $db_alias Alias of db
|
||||
* @param string $db Database name
|
||||
* @param string $export_type 'server', 'database', 'table'
|
||||
* @param string $db_alias Aliases of db
|
||||
*
|
||||
* @return bool Whether it succeeded
|
||||
*/
|
||||
public function exportDBCreate($db, $db_alias = '')
|
||||
public function exportDBCreate($db, $export_type, $db_alias = '')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -165,12 +165,13 @@ class ExportHtmlword extends ExportPlugin
|
||||
/**
|
||||
* Outputs CREATE DATABASE statement
|
||||
*
|
||||
* @param string $db Database name
|
||||
* @param string $db_alias Aliases of db
|
||||
* @param string $db Database name
|
||||
* @param string $export_type 'server', 'database', 'table'
|
||||
* @param string $db_alias Aliases of db
|
||||
*
|
||||
* @return bool Whether it succeeded
|
||||
*/
|
||||
public function exportDBCreate($db, $db_alias = '')
|
||||
public function exportDBCreate($db, $export_type, $db_alias = '')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -141,12 +141,13 @@ class ExportJson extends ExportPlugin
|
||||
/**
|
||||
* Outputs CREATE DATABASE statement
|
||||
*
|
||||
* @param string $db Database name
|
||||
* @param string $db_alias Aliases of db
|
||||
* @param string $db Database name
|
||||
* @param string $export_type 'server', 'database', 'table'
|
||||
* @param string $db_alias Aliases of db
|
||||
*
|
||||
* @return bool Whether it succeeded
|
||||
*/
|
||||
public function exportDBCreate($db, $db_alias = '')
|
||||
public function exportDBCreate($db, $export_type, $db_alias = '')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -259,12 +259,13 @@ class ExportLatex extends ExportPlugin
|
||||
/**
|
||||
* Outputs CREATE DATABASE statement
|
||||
*
|
||||
* @param string $db Database name
|
||||
* @param string $db_alias Aliases of db
|
||||
* @param string $db Database name
|
||||
* @param string $export_type 'server', 'database', 'table'
|
||||
* @param string $db_alias Aliases of db
|
||||
*
|
||||
* @return bool Whether it succeeded
|
||||
*/
|
||||
public function exportDBCreate($db, $db_alias = '')
|
||||
public function exportDBCreate($db, $export_type, $db_alias = '')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -145,12 +145,13 @@ class ExportMediawiki extends ExportPlugin
|
||||
/**
|
||||
* Outputs CREATE DATABASE statement
|
||||
*
|
||||
* @param string $db Database name
|
||||
* @param string $db_alias Alias of db
|
||||
* @param string $db Database name
|
||||
* @param string $export_type 'server', 'database', 'table'
|
||||
* @param string $db_alias Aliases of db
|
||||
*
|
||||
* @return bool Whether it succeeded
|
||||
*/
|
||||
public function exportDBCreate($db, $db_alias = '')
|
||||
public function exportDBCreate($db, $export_type, $db_alias = '')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -189,12 +189,13 @@ class ExportOds extends ExportPlugin
|
||||
/**
|
||||
* Outputs CREATE DATABASE statement
|
||||
*
|
||||
* @param string $db Database name
|
||||
* @param string $db_alias Aliases of db
|
||||
* @param string $db Database name
|
||||
* @param string $export_type 'server', 'database', 'table'
|
||||
* @param string $db_alias Aliases of db
|
||||
*
|
||||
* @return bool Whether it succeeded
|
||||
*/
|
||||
public function exportDBCreate($db, $db_alias = '')
|
||||
public function exportDBCreate($db, $export_type, $db_alias = '')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -210,12 +210,13 @@ class ExportOdt extends ExportPlugin
|
||||
/**
|
||||
* Outputs CREATE DATABASE statement
|
||||
*
|
||||
* @param string $db Database name
|
||||
* @param string $db_alias Aliases of db
|
||||
* @param string $db Database name
|
||||
* @param string $export_type 'server', 'database', 'table'
|
||||
* @param string $db_alias Aliases of db
|
||||
*
|
||||
* @return bool Whether it succeeded
|
||||
*/
|
||||
public function exportDBCreate($db, $db_alias = '')
|
||||
public function exportDBCreate($db, $export_type, $db_alias = '')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -193,12 +193,13 @@ class ExportPdf extends ExportPlugin
|
||||
/**
|
||||
* Outputs CREATE DATABASE statement
|
||||
*
|
||||
* @param string $db Database name
|
||||
* @param string $db_alias Aliases of db
|
||||
* @param string $db Database name
|
||||
* @param string $export_type 'server', 'database', 'table'
|
||||
* @param string $db_alias Aliases of db
|
||||
*
|
||||
* @return bool Whether it succeeded
|
||||
*/
|
||||
public function exportDBCreate($db, $db_alias = '')
|
||||
public function exportDBCreate($db, $export_type, $db_alias = '')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -132,12 +132,13 @@ class ExportPhparray extends ExportPlugin
|
||||
/**
|
||||
* Outputs CREATE DATABASE statement
|
||||
*
|
||||
* @param string $db Database name
|
||||
* @param string $db_alias Aliases of db
|
||||
* @param string $db Database name
|
||||
* @param string $export_type 'server', 'database', 'table'
|
||||
* @param string $db_alias Aliases of db
|
||||
*
|
||||
* @return bool Whether it succeeded
|
||||
*/
|
||||
public function exportDBCreate($db, $db_alias = '')
|
||||
public function exportDBCreate($db, $export_type, $db_alias = '')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -189,16 +189,6 @@ class ExportSql extends ExportPlugin
|
||||
unset($values);
|
||||
}
|
||||
|
||||
// server export options
|
||||
if ($plugin_param['export_type'] == 'server') {
|
||||
$leaf = new BoolPropertyItem();
|
||||
$leaf->setName("drop_database");
|
||||
$leaf->setText(
|
||||
sprintf(__('Add %s statement'), '<code>DROP DATABASE</code>')
|
||||
);
|
||||
$generalOptions->addProperty($leaf);
|
||||
}
|
||||
|
||||
// what to dump (structure/data/both)
|
||||
$subgroup = new OptionsPropertySubgroup();
|
||||
$subgroup->setName("dump_table");
|
||||
@ -232,7 +222,17 @@ class ExportSql extends ExportPlugin
|
||||
$leaf->setText(__('Add statements:'));
|
||||
$subgroup->setSubgroupHeader($leaf);
|
||||
|
||||
if ($plugin_param['export_type'] != 'table') {
|
||||
// server export options
|
||||
if ($plugin_param['export_type'] == 'server') {
|
||||
$leaf = new BoolPropertyItem();
|
||||
$leaf->setName("drop_database");
|
||||
$leaf->setText(
|
||||
sprintf(__('Add %s statement'), '<code>DROP DATABASE</code>')
|
||||
);
|
||||
$subgroup->addProperty($leaf);
|
||||
}
|
||||
|
||||
if ($plugin_param['export_type'] == 'database') {
|
||||
$leaf = new BoolPropertyItem();
|
||||
$leaf->setName('create_database');
|
||||
$create_clause = '<code>CREATE DATABASE / USE</code>';
|
||||
@ -768,12 +768,13 @@ class ExportSql extends ExportPlugin
|
||||
/**
|
||||
* Outputs CREATE DATABASE statement
|
||||
*
|
||||
* @param string $db Database name
|
||||
* @param string $db_alias Aliases of db
|
||||
* @param string $db Database name
|
||||
* @param string $export_type 'server', 'database', 'table'
|
||||
* @param string $db_alias Aliases of db
|
||||
*
|
||||
* @return bool Whether it succeeded
|
||||
*/
|
||||
public function exportDBCreate($db, $db_alias = '')
|
||||
public function exportDBCreate($db, $export_type, $db_alias = '')
|
||||
{
|
||||
global $crlf;
|
||||
|
||||
@ -796,7 +797,7 @@ class ExportSql extends ExportPlugin
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!isset($GLOBALS['sql_create_database'])) {
|
||||
if ($export_type == 'database' && !isset($GLOBALS['sql_create_database'])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -149,12 +149,13 @@ class ExportTexytext extends ExportPlugin
|
||||
/**
|
||||
* Outputs CREATE DATABASE statement
|
||||
*
|
||||
* @param string $db Database name
|
||||
* @param string $db_alias Alias of db
|
||||
* @param string $db Database name
|
||||
* @param string $export_type 'server', 'database', 'table'
|
||||
* @param string $db_alias Aliases of db
|
||||
*
|
||||
* @return bool Whether it succeeded
|
||||
*/
|
||||
public function exportDBCreate($db, $db_alias = '')
|
||||
public function exportDBCreate($db, $export_type, $db_alias = '')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -453,12 +453,13 @@ class ExportXml extends ExportPlugin
|
||||
/**
|
||||
* Outputs CREATE DATABASE statement
|
||||
*
|
||||
* @param string $db Database name
|
||||
* @param string $db_alias Aliases of db
|
||||
* @param string $db Database name
|
||||
* @param string $export_type 'server', 'database', 'table'
|
||||
* @param string $db_alias Aliases of db
|
||||
*
|
||||
* @return bool Whether it succeeded
|
||||
*/
|
||||
public function exportDBCreate($db, $db_alias = '')
|
||||
public function exportDBCreate($db, $export_type, $db_alias = '')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -122,12 +122,13 @@ class ExportYaml extends ExportPlugin
|
||||
/**
|
||||
* Outputs CREATE DATABASE statement
|
||||
*
|
||||
* @param string $db Database name
|
||||
* @param string $db_alias Aliases of db
|
||||
* @param string $db Database name
|
||||
* @param string $export_type 'server', 'database', 'table'
|
||||
* @param string $db_alias Aliases of db
|
||||
*
|
||||
* @return bool Whether it succeeded
|
||||
*/
|
||||
public function exportDBCreate($db, $db_alias = '')
|
||||
public function exportDBCreate($db, $export_type, $db_alias = '')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -467,7 +467,7 @@ class PMA_ExportCsv_Test extends PHPUnit_Framework_TestCase
|
||||
public function testExportDBCreate()
|
||||
{
|
||||
$this->assertTrue(
|
||||
$this->object->exportDBCreate('testDB')
|
||||
$this->object->exportDBCreate('testDB', 'database')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -327,7 +327,7 @@ class PMA_ExportHtmlword_Test extends PHPUnit_Framework_TestCase
|
||||
public function testExportDBCreate()
|
||||
{
|
||||
$this->assertTrue(
|
||||
$this->object->exportDBCreate('testDB')
|
||||
$this->object->exportDBCreate('testDB', 'database')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -202,7 +202,7 @@ class PMA_ExportJson_Test extends PHPUnit_Framework_TestCase
|
||||
public function testExportDBCreate()
|
||||
{
|
||||
$this->assertTrue(
|
||||
$this->object->exportDBCreate('testDB')
|
||||
$this->object->exportDBCreate('testDB', 'database')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -548,7 +548,7 @@ class PMA_ExportLatex_Test extends PHPUnit_Framework_TestCase
|
||||
public function testExportDBCreate()
|
||||
{
|
||||
$this->assertTrue(
|
||||
$this->object->exportDBCreate('testDB')
|
||||
$this->object->exportDBCreate('testDB', 'database')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -251,7 +251,7 @@ class PMA_ExportMediawiki_Test extends PHPUnit_Framework_TestCase
|
||||
public function testExportDBCreate()
|
||||
{
|
||||
$this->assertTrue(
|
||||
$this->object->exportDBCreate('testDB')
|
||||
$this->object->exportDBCreate('testDB', 'database')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -254,7 +254,7 @@ class PMA_ExportOds_Test extends PHPUnit_Framework_TestCase
|
||||
public function testExportDBCreate()
|
||||
{
|
||||
$this->assertTrue(
|
||||
$this->object->exportDBCreate('testDB')
|
||||
$this->object->exportDBCreate('testDB', 'database')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -402,7 +402,7 @@ class PMA_ExportOdt_Test extends PHPUnit_Framework_TestCase
|
||||
public function testExportDBCreate()
|
||||
{
|
||||
$this->assertTrue(
|
||||
$this->object->exportDBCreate('testDB')
|
||||
$this->object->exportDBCreate('testDB', 'database')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -260,7 +260,7 @@ class PMA_ExportPdf_Test extends PHPUnit_Framework_TestCase
|
||||
public function testExportDBCreate()
|
||||
{
|
||||
$this->assertTrue(
|
||||
$this->object->exportDBCreate('testDB')
|
||||
$this->object->exportDBCreate('testDB', 'database')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -199,7 +199,7 @@ class PMA_ExportPhparray_Test extends PHPUnit_Framework_TestCase
|
||||
public function testExportDBCreate()
|
||||
{
|
||||
$this->assertTrue(
|
||||
$this->object->exportDBCreate('testDB')
|
||||
$this->object->exportDBCreate('testDB', 'database')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -224,12 +224,6 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase
|
||||
$property->getValues()
|
||||
);
|
||||
|
||||
$property = array_shift($properties);
|
||||
$this->assertInstanceOf(
|
||||
'BoolPropertyItem',
|
||||
$property
|
||||
);
|
||||
|
||||
$property = array_shift($properties);
|
||||
$this->assertInstanceOf(
|
||||
'OptionsPropertySubgroup',
|
||||
@ -424,13 +418,13 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase
|
||||
$properties = $properties[0]->getProperties();
|
||||
|
||||
$this->assertCount(
|
||||
5,
|
||||
4,
|
||||
$properties
|
||||
);
|
||||
|
||||
$this->assertNotcontains(
|
||||
'<code> / EVENT </code>',
|
||||
$properties[1]->getText()
|
||||
$properties[0]->getText()
|
||||
);
|
||||
|
||||
// dataOptions
|
||||
@ -787,7 +781,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase
|
||||
|
||||
ob_start();
|
||||
$this->assertTrue(
|
||||
$this->object->exportDBCreate('db')
|
||||
$this->object->exportDBCreate('db', 'database')
|
||||
);
|
||||
$result = ob_get_clean();
|
||||
|
||||
@ -825,7 +819,7 @@ class PMA_ExportSql_Test extends PHPUnit_Framework_TestCase
|
||||
|
||||
ob_start();
|
||||
$this->assertTrue(
|
||||
$this->object->exportDBCreate('db')
|
||||
$this->object->exportDBCreate('db', 'database')
|
||||
);
|
||||
$result = ob_get_clean();
|
||||
|
||||
|
||||
@ -232,7 +232,7 @@ class PMA_ExportTexytext_Test extends PHPUnit_Framework_TestCase
|
||||
public function testExportDBCreate()
|
||||
{
|
||||
$this->assertTrue(
|
||||
$this->object->exportDBCreate('testDB')
|
||||
$this->object->exportDBCreate('testDB', 'database')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -640,7 +640,7 @@ class PMA_ExportXml_Test extends PHPUnit_Framework_TestCase
|
||||
public function testExportDBCreate()
|
||||
{
|
||||
$this->assertTrue(
|
||||
$this->object->exportDBCreate('testDB')
|
||||
$this->object->exportDBCreate('testDB', 'database')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -188,7 +188,7 @@ class PMA_ExportYaml_Test extends PHPUnit_Framework_TestCase
|
||||
public function testExportDBCreate()
|
||||
{
|
||||
$this->assertTrue(
|
||||
$this->object->exportDBCreate('testDB')
|
||||
$this->object->exportDBCreate('testDB', 'database')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user