getTableDef in ExportOdt

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
Kamil Tekiela 2023-05-12 22:15:49 +01:00
parent 3a5f6c924d
commit 99426f4d23
3 changed files with 13 additions and 51 deletions

View File

@ -387,32 +387,24 @@ class ExportOdt extends ExportPlugin
/**
* Returns $table's CREATE definition
*
* @param string $db the database name
* @param string $table the table name
* @param string $errorUrl the url to go back in case of error
* @param bool $doRelation whether to include relation comments
* @param bool $doComments whether to include the pmadb-style column
* comments as comments in the structure;
* this is deprecated but the parameter is
* left here because /export calls
* PMA_exportStructure() also for other
* @param bool $doMime whether to include mime comments
* @param bool $showDates whether to include creation/update/check dates
* @param bool $addSemicolon whether to add semicolon and end-of-line at
* the end
* @param bool $view whether we're handling a view
* @param mixed[] $aliases Aliases of db/table/columns
* @param string $db the database name
* @param string $table the table name
* @param bool $doRelation whether to include relation comments
* @param bool $doComments whether to include the pmadb-style column
* comments as comments in the structure;
* this is deprecated but the parameter is
* left here because /export calls
* PMA_exportStructure() also for other
* @param bool $doMime whether to include mime comments
* the end
* @param mixed[] $aliases Aliases of db/table/columns
*/
public function getTableDef(
string $db,
string $table,
string $errorUrl,
bool $doRelation,
bool $doComments,
bool $doMime,
bool $showDates = false,
bool $addSemicolon = true,
bool $view = false,
array $aliases = [],
): bool {
$dbAlias = $db;
@ -660,18 +652,7 @@ class ExportOdt extends ExportPlugin
. __('Table structure for table') . ' ' .
htmlspecialchars($tableAlias)
. '</text:h>';
$this->getTableDef(
$db,
$table,
$errorUrl,
$doRelation,
$doComments,
$doMime,
$dates,
true,
false,
$aliases,
);
$this->getTableDef($db, $table, $doRelation, $doComments, $doMime, $aliases);
break;
case 'triggers':
$triggers = Triggers::getDetails($GLOBALS['dbi'], $db, $table);
@ -691,18 +672,7 @@ class ExportOdt extends ExportPlugin
. __('Structure for view') . ' '
. htmlspecialchars($tableAlias)
. '</text:h>';
$this->getTableDef(
$db,
$table,
$errorUrl,
$doRelation,
$doComments,
$doMime,
$dates,
true,
true,
$aliases,
);
$this->getTableDef($db, $table, $doRelation, $doComments, $doMime, $aliases);
break;
case 'stand_in':
$GLOBALS['odt_buffer'] .= '<text:h text:outline-level="2" text:style-name="Heading_2"'

View File

@ -9434,12 +9434,6 @@
<code><![CDATA[$GLOBALS['plugin_param']['export_type']]]></code>
<code><![CDATA[$GLOBALS['plugin_param']['single_table']]]></code>
</PossiblyNullArrayAccess>
<PossiblyUnusedParam>
<code>$addSemicolon</code>
<code>$errorUrl</code>
<code>$showDates</code>
<code>$view</code>
</PossiblyUnusedParam>
<PossiblyUnusedReturnValue>
<code>string</code>
</PossiblyUnusedReturnValue>

View File

@ -632,7 +632,6 @@ class ExportOdtTest extends AbstractTestCase
$this->object->getTableDef(
'database',
'',
'example.com',
true,
true,
true,
@ -715,7 +714,6 @@ class ExportOdtTest extends AbstractTestCase
$this->object->getTableDef(
'database',
'',
'example.com',
true,
true,
true,