Merge pull request #20103 from kamil-tekiela/Properties-2

Refactoring of Properties 2
This commit is contained in:
Maurício Meneghini Fauth 2026-02-25 21:17:33 -03:00 committed by GitHub
commit 71ac9f7143
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
28 changed files with 558 additions and 564 deletions

View File

@ -8283,30 +8283,12 @@ parameters:
count: 1
path: src/Plugins.php
-
message: '#^Cannot cast mixed to string\.$#'
identifier: cast.string
count: 2
path: src/Plugins.php
-
message: '#^Construct empty\(\) is not allowed\. Use more strict comparison\.$#'
identifier: empty.notAllowed
count: 1
path: src/Plugins.php
-
message: '#^Loose comparison via "\!\=" is not allowed\.$#'
identifier: notEqual.notAllowed
count: 1
path: src/Plugins.php
-
message: '#^Loose comparison via "\=\=" is not allowed\.$#'
identifier: equal.notAllowed
count: 2
path: src/Plugins.php
-
message: '''
#^Call to deprecated method getInstance\(\) of class PhpMyAdmin\\Config\:
@ -10563,6 +10545,18 @@ parameters:
count: 1
path: src/Profiling.php
-
message: '#^Loose comparison via "\=\=" is not allowed\.$#'
identifier: equal.notAllowed
count: 1
path: src/Properties/Options/Items/RadioPropertyItem.php
-
message: '#^Loose comparison via "\=\=" is not allowed\.$#'
identifier: equal.notAllowed
count: 1
path: src/Properties/Options/Items/SelectPropertyItem.php
-
message: '#^Loose comparison via "\=\=" is not allowed\.$#'
identifier: equal.notAllowed
@ -16368,12 +16362,6 @@ parameters:
count: 1
path: tests/unit/PluginsTest.php
-
message: '#^You should use assertCount\(\$expectedCount, \$variable\) instead of assertSame\(\$expectedCount, \$variable\-\>count\(\)\)\.$#'
identifier: phpunit.assertCount
count: 1
path: tests/unit/Properties/Options/OptionsPropertyGroupTest.php
-
message: '''
#^Call to deprecated method getInstance\(\) of class PhpMyAdmin\\Config\:

View File

@ -5589,43 +5589,15 @@
<code><![CDATA[Config::getInstance()]]></code>
<code><![CDATA[Config::getInstance()]]></code>
</DeprecatedMethod>
<MixedAssignment>
<code><![CDATA[$val]]></code>
<code><![CDATA[$val]]></code>
</MixedAssignment>
<PossiblyInvalidCast>
<code><![CDATA[$config->settings[$section][$opt]]]></code>
<code><![CDATA[$config->settings[$pluginType->value][$opt]]]></code>
</PossiblyInvalidCast>
<PossiblyNullOperand>
<code><![CDATA[$pitem->getName()]]></code>
<code><![CDATA[$pitem->getName()]]></code>
<code><![CDATA[$pitem->getName()]]></code>
<code><![CDATA[$pitem->getName()]]></code>
<code><![CDATA[$pitem->getName()]]></code>
<code><![CDATA[$pitem->getName()]]></code>
<code><![CDATA[$pitem->getName()]]></code>
<code><![CDATA[$pitem->getName()]]></code>
<code><![CDATA[$pitem->getName()]]></code>
<code><![CDATA[$pitem->getName()]]></code>
<code><![CDATA[$pitem->getName()]]></code>
<code><![CDATA[$pitem->getName()]]></code>
<code><![CDATA[$propertyGroup->getName()]]></code>
<code><![CDATA[$propertyItem->getForce()]]></code>
<code><![CDATA[$propertyItem->getForce()]]></code>
<code><![CDATA[$propertyItem->getName()]]></code>
<code><![CDATA[$propertyItem->getName()]]></code>
<code><![CDATA[$propertyItem->getName()]]></code>
<code><![CDATA[$propertyItem->getName()]]></code>
<code><![CDATA[$propertyItem->getName()]]></code>
<code><![CDATA[$propertyItem->getName()]]></code>
<code><![CDATA[$propertyItem->getName()]]></code>
<code><![CDATA[$propertyItem->getName()]]></code>
<code><![CDATA[$propertyItem->getName()]]></code>
<code><![CDATA[$propertyItem->getName()]]></code>
<code><![CDATA[$subgroupHeader->getName()]]></code>
</PossiblyNullOperand>
<RiskyTruthyFalsyComparison>
<code><![CDATA[empty(Config::getInstance()->settings[$section][$opt])]]></code>
<code><![CDATA[empty(Config::getInstance()->settings[$pluginType->value][$opt])]]></code>
</RiskyTruthyFalsyComparison>
</file>
<file src="src/Plugins/Auth/AuthenticationConfig.php">
@ -7213,6 +7185,54 @@
<code><![CDATA[$dbi->fetchValue('SELECT @@have_profiling')]]></code>
</RiskyTruthyFalsyComparison>
</file>
<file src="src/Properties/Options/Items/BoolPropertyItem.php">
<PossiblyNullOperand>
<code><![CDATA[$this->getForce()]]></code>
<code><![CDATA[$this->getForce()]]></code>
<code><![CDATA[$this->getName()]]></code>
<code><![CDATA[$this->getName()]]></code>
<code><![CDATA[$this->getName()]]></code>
<code><![CDATA[$this->getName()]]></code>
</PossiblyNullOperand>
</file>
<file src="src/Properties/Options/Items/HiddenPropertyItem.php">
<PossiblyNullOperand>
<code><![CDATA[$this->getName()]]></code>
<code><![CDATA[$this->getName()]]></code>
</PossiblyNullOperand>
</file>
<file src="src/Properties/Options/Items/NumberPropertyItem.php">
<PossiblyNullOperand>
<code><![CDATA[$this->getName()]]></code>
<code><![CDATA[$this->getName()]]></code>
<code><![CDATA[$this->getName()]]></code>
<code><![CDATA[$this->getName()]]></code>
</PossiblyNullOperand>
</file>
<file src="src/Properties/Options/Items/RadioPropertyItem.php">
<PossiblyNullOperand>
<code><![CDATA[$this->getName()]]></code>
<code><![CDATA[$this->getName()]]></code>
<code><![CDATA[$this->getName()]]></code>
<code><![CDATA[$this->getName()]]></code>
</PossiblyNullOperand>
</file>
<file src="src/Properties/Options/Items/SelectPropertyItem.php">
<PossiblyNullOperand>
<code><![CDATA[$this->getName()]]></code>
<code><![CDATA[$this->getName()]]></code>
<code><![CDATA[$this->getName()]]></code>
<code><![CDATA[$this->getName()]]></code>
</PossiblyNullOperand>
</file>
<file src="src/Properties/Options/Items/TextPropertyItem.php">
<PossiblyNullOperand>
<code><![CDATA[$this->getName()]]></code>
<code><![CDATA[$this->getName()]]></code>
<code><![CDATA[$this->getName()]]></code>
<code><![CDATA[$this->getName()]]></code>
</PossiblyNullOperand>
</file>
<file src="src/Query/Compatibility.php">
<PossiblyInvalidArgument>
<code><![CDATA[$eachTables[$tableName]['Comment'] ?? '']]></code>

View File

@ -20,6 +20,7 @@ use PhpMyAdmin\Import\Import;
use PhpMyAdmin\Import\ImportSettings;
use PhpMyAdmin\Message;
use PhpMyAdmin\Plugins;
use PhpMyAdmin\Plugins\PluginType;
use PhpMyAdmin\ResponseRenderer;
use PhpMyAdmin\Routing\Route;
use PhpMyAdmin\Util;
@ -93,9 +94,9 @@ final readonly class ImportController implements InvocableController
$hiddenInputs = [$idKey => $uploadId, 'import_type' => 'database', 'db' => Current::$database];
$choice = Plugins::getChoice($importList, $this->getFormat($request->getParam('format')));
$options = Plugins::getOptions('Import', $importList);
$options = Plugins::getOptions(PluginType::Import, $importList);
$skipQueriesDefault = $this->getSkipQueries($request->getParam('skip_queries'));
$isAllowInterruptChecked = Plugins::checkboxCheck('Import', 'allow_interrupt');
$isAllowInterruptChecked = Plugins::checkboxCheck(PluginType::Import, 'allow_interrupt');
$maxUploadSize = Util::getUploadSizeInBytes();
$this->response->render('database/import/index', [

View File

@ -18,6 +18,7 @@ use PhpMyAdmin\Import\Import;
use PhpMyAdmin\Import\ImportSettings;
use PhpMyAdmin\Message;
use PhpMyAdmin\Plugins;
use PhpMyAdmin\Plugins\PluginType;
use PhpMyAdmin\ResponseRenderer;
use PhpMyAdmin\Routing\Route;
use PhpMyAdmin\Util;
@ -78,9 +79,9 @@ final readonly class ImportController implements InvocableController
$hiddenInputs = [$idKey => $uploadId, 'import_type' => 'server'];
$choice = Plugins::getChoice($importList, $this->getFormat($request->getParam('format')));
$options = Plugins::getOptions('Import', $importList);
$options = Plugins::getOptions(PluginType::Import, $importList);
$skipQueriesDefault = $this->getSkipQueries($request->getParam('skip_queries'));
$isAllowInterruptChecked = Plugins::checkboxCheck('Import', 'allow_interrupt');
$isAllowInterruptChecked = Plugins::checkboxCheck(PluginType::Import, 'allow_interrupt');
$maxUploadSize = Util::getUploadSizeInBytes();
$this->response->render('server/import/index', [

View File

@ -21,6 +21,7 @@ use PhpMyAdmin\Import\Import;
use PhpMyAdmin\Import\ImportSettings;
use PhpMyAdmin\Message;
use PhpMyAdmin\Plugins;
use PhpMyAdmin\Plugins\PluginType;
use PhpMyAdmin\ResponseRenderer;
use PhpMyAdmin\Routing\Route;
use PhpMyAdmin\Url;
@ -122,9 +123,9 @@ final readonly class ImportController implements InvocableController
];
$choice = Plugins::getChoice($importList, $this->getFormat($request->getParam('format')));
$options = Plugins::getOptions('Import', $importList);
$options = Plugins::getOptions(PluginType::Import, $importList);
$skipQueriesDefault = $this->getSkipQueries($request->getParam('skip_queries'));
$isAllowInterruptChecked = Plugins::checkboxCheck('Import', 'allow_interrupt');
$isAllowInterruptChecked = Plugins::checkboxCheck(PluginType::Import, 'allow_interrupt');
$maxUploadSize = Util::getUploadSizeInBytes();
$this->response->render('table/import/index', [

View File

@ -12,6 +12,7 @@ use PhpMyAdmin\Database\Designer\DesignerTable;
use PhpMyAdmin\Dbal\DatabaseInterface;
use PhpMyAdmin\Message;
use PhpMyAdmin\Plugins;
use PhpMyAdmin\Plugins\PluginType;
use PhpMyAdmin\Template;
use PhpMyAdmin\Util;
use stdClass;
@ -118,7 +119,7 @@ class Designer
}
$choice = Plugins::getChoice($exportList, $this->getFormat($formatParam, $exportTypeParam));
$options = Plugins::getOptions('Schema', $exportList);
$options = Plugins::getOptions(PluginType::Schema, $exportList);
return $this->template->render('database/designer/schema_export', [
'db' => $db,

View File

@ -13,6 +13,7 @@ use PhpMyAdmin\Encoding;
use PhpMyAdmin\Plugins;
use PhpMyAdmin\Plugins\ExportPlugin;
use PhpMyAdmin\Plugins\ExportType;
use PhpMyAdmin\Plugins\PluginType;
use PhpMyAdmin\Query\Utilities;
use PhpMyAdmin\Table\Table;
use PhpMyAdmin\Util;
@ -178,7 +179,7 @@ final readonly class Options
'hidden_inputs' => $hiddenInputs,
'export_method' => $_POST['quick_or_custom'] ?? $config->config->Export->method,
'plugins_choice' => $dropdown,
'options' => Plugins::getOptions('Export', $exportList),
'options' => Plugins::getOptions(PluginType::Export, $exportList),
'can_convert_kanji' => Encoding::canConvertKanji(),
'exec_time_limit' => $config->settings['ExecTimeLimit'],
'rows' => $rows,

View File

@ -16,17 +16,11 @@ use PhpMyAdmin\Plugins\ExportPlugin;
use PhpMyAdmin\Plugins\ExportType;
use PhpMyAdmin\Plugins\ImportPlugin;
use PhpMyAdmin\Plugins\Plugin;
use PhpMyAdmin\Plugins\PluginType;
use PhpMyAdmin\Plugins\SchemaPlugin;
use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyMainGroup;
use PhpMyAdmin\Properties\Options\Groups\OptionsPropertySubgroup;
use PhpMyAdmin\Properties\Options\Items\BoolPropertyItem;
use PhpMyAdmin\Properties\Options\Items\DocPropertyItem;
use PhpMyAdmin\Properties\Options\Items\HiddenPropertyItem;
use PhpMyAdmin\Properties\Options\Items\MessageOnlyPropertyItem;
use PhpMyAdmin\Properties\Options\Items\NumberPropertyItem;
use PhpMyAdmin\Properties\Options\Items\RadioPropertyItem;
use PhpMyAdmin\Properties\Options\Items\SelectPropertyItem;
use PhpMyAdmin\Properties\Options\Items\TextPropertyItem;
use PhpMyAdmin\Properties\Options\OptionsPropertyGroup;
use PhpMyAdmin\Properties\Options\OptionsPropertyItem;
use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem;
@ -36,9 +30,6 @@ use Throwable;
use function __;
use function class_exists;
use function count;
use function htmlspecialchars;
use function in_array;
use function is_array;
use function is_string;
use function is_subclass_of;
use function mb_strtolower;
@ -201,21 +192,18 @@ class Plugins
* Returns html input tag option 'checked' if plugin $opt
* should be set by config or request
*
* @param string $section name of config section in
* \PhpMyAdmin\Config::getInstance()->settings[$section] for plugin
* @param string $opt name of option
* @psalm-param 'Export'|'Import'|'Schema' $section
* @param string $opt name of option
*
* @return string html input tag option 'checked'
*/
public static function checkboxCheck(string $section, string $opt): string
public static function checkboxCheck(PluginType $pluginType, string $opt): string
{
// If the form is being repopulated using $_GET data, that is priority
if (
isset($_GET[$opt])
|| ! isset($_GET['repopulate'])
&& ((ImportSettings::$timeoutPassed && isset($_REQUEST[$opt]))
|| ! empty(Config::getInstance()->settings[$section][$opt]))
|| ! empty(Config::getInstance()->settings[$pluginType->value][$opt]))
) {
return ' checked';
}
@ -226,14 +214,12 @@ class Plugins
/**
* Returns default value for option $opt
*
* @param string $section name of config section in
* \PhpMyAdmin\Config::getInstance()->settings[$section] for plugin
* @param string $opt name of option
* @psalm-param 'Export'|'Import'|'Schema' $section
* @param PluginType $pluginType type of the plugin
* @param string $opt name of option
*
* @return string default value for option $opt
*/
public static function getDefault(string $section, string $opt): string
public static function getDefault(PluginType $pluginType, string $opt): string
{
if (isset($_GET[$opt]) && is_string($_GET[$opt])) {
// If the form is being repopulated using $_GET data, that is priority
@ -245,8 +231,8 @@ class Plugins
}
$config = Config::getInstance();
if (isset($config->settings[$section][$opt])) {
return (string) $config->settings[$section][$opt];
if (isset($config->settings[$pluginType->value][$opt])) {
return (string) $config->settings[$pluginType->value][$opt];
}
return '';
@ -278,22 +264,20 @@ class Plugins
/**
* Returns single option in a list element
*
* @param string $section name of config section in $cfg[$section] for plugin
* @param string $pluginName unique plugin name
* @param OptionsPropertyItem $propertyGroup options property main group instance
* @param bool $isSubgroup if this group is a subgroup
* @psalm-param 'Export'|'Import'|'Schema' $section
*
* @return string table row with option
*/
private static function getOneOption(
Plugin $plugin,
string $section,
PluginType $pluginType,
string $pluginName,
OptionsPropertyItem $propertyGroup,
bool $isSubgroup = false,
): string {
$ret = "\n";
$ret = '';
$properties = null;
if (! $isSubgroup) {
@ -302,7 +286,7 @@ class Plugins
$properties = [$propertyGroup];
} else {
// for main groups
$ret .= '<div id="' . $pluginName . '_' . $propertyGroup->getName() . '">';
$ret .= "\n" . '<div id="' . $pluginName . '_' . $propertyGroup->getName() . '">';
$text = null;
if (method_exists($propertyGroup, 'getText')) {
@ -313,7 +297,7 @@ class Plugins
$ret .= '<h5 class="card-title mt-4 mb-2">' . $plugin->getTranslatedText($text) . '</h5>';
}
$ret .= '<ul class="list-group">';
$ret .= '<ul class="list-group">' . "\n";
}
}
@ -325,17 +309,15 @@ class Plugins
}
}
$propertyClass = null;
if ($properties !== null) {
foreach ($properties as $propertyItem) {
$propertyClass = $propertyItem::class;
// if the property is a subgroup, we deal with it recursively
if ($propertyItem instanceof OptionsPropertySubgroup) {
// for subgroups
// each subgroup can have a header, which may also be a form element
$subgroupHeader = $propertyItem->getSubgroupHeader();
if ($subgroupHeader !== null) {
$ret .= self::getOneOption($plugin, $section, $pluginName, $subgroupHeader);
$ret .= self::getOneOption($plugin, $pluginType, $pluginName, $subgroupHeader);
}
$ret .= '<li class="list-group-item"><ul class="list-group"';
@ -345,226 +327,49 @@ class Plugins
$ret .= '>';
}
$ret .= self::getOneOption($plugin, $section, $pluginName, $propertyItem, true);
$ret .= "\n";
$ret .= self::getOneOption($plugin, $pluginType, $pluginName, $propertyItem, true);
continue;
}
// single property item
$ret .= self::getHtmlForProperty($plugin, $section, $pluginName, $propertyItem);
$ret .= self::getHtmlForProperty($plugin, $pluginType, $pluginName, $propertyItem);
}
}
if ($isSubgroup) {
// end subgroup
$ret .= '</ul></li>';
$ret .= '</ul>' . "\n";
} elseif ($notSubgroupHeader) {
// end main group
$ret .= '</ul></div>';
}
if ($propertyGroup instanceof OptionsPropertyOneItem) {
$doc = $propertyGroup->getDoc();
if (is_array($doc)) {
if (count($doc) === 3) {
$ret .= MySQLDocumentation::show($doc[1], false, null, null, $doc[2]);
} elseif (count($doc) === 1) {
$ret .= MySQLDocumentation::showDocumentation('faq', $doc[0]);
} else {
$ret .= MySQLDocumentation::show($doc[1]);
}
}
}
// Close the list element after $doc link is displayed
if (
in_array($propertyClass, [
BoolPropertyItem::class,
MessageOnlyPropertyItem::class,
SelectPropertyItem::class,
TextPropertyItem::class,
], true)
) {
$ret .= '</li>';
}
return $ret . "\n";
}
/**
* Get HTML for properties items
*
* @param string $section name of config section in $cfg[$section] for plugin
* @param string $pluginName unique plugin name
* @param OptionsPropertyItem $propertyItem Property item
* @psalm-param 'Export'|'Import'|'Schema' $section
*/
public static function getHtmlForProperty(
Plugin $plugin,
string $section,
string $pluginName,
OptionsPropertyItem $propertyItem,
): string {
$ret = '';
$propertyClass = $propertyItem::class;
switch ($propertyClass) {
case BoolPropertyItem::class:
$ret .= '<li class="list-group-item">' . "\n";
$ret .= '<div class="form-check form-switch">' . "\n";
$ret .= '<input class="form-check-input" type="checkbox" role="switch" name="' . $pluginName . '_'
. $propertyItem->getName() . '"'
. ' value="y" id="checkbox_' . $pluginName . '_'
. $propertyItem->getName() . '"'
. ' '
. self::checkboxCheck(
$section,
$pluginName . '_' . $propertyItem->getName(),
);
if ($propertyItem->getForce() != null) {
// Same code is also few lines lower, update both if needed
$ret .= ' onclick="if (!this.checked &amp;&amp; '
. '(!document.getElementById(\'checkbox_' . $pluginName
. '_' . $propertyItem->getForce() . '\') '
. '|| !document.getElementById(\'checkbox_'
. $pluginName . '_' . $propertyItem->getForce()
. '\').checked)) '
. 'return false; else return true;"';
}
$ret .= '>';
$ret .= '<label class="form-check-label" for="checkbox_' . $pluginName . '_'
. $propertyItem->getName() . '">'
. $plugin->getTranslatedText($propertyItem->getText() ?? '') . '</label></div>';
break;
case DocPropertyItem::class:
echo DocPropertyItem::class;
break;
case HiddenPropertyItem::class:
$ret .= '<li class="list-group-item"><input type="hidden" name="' . $pluginName . '_'
. $propertyItem->getName() . '"'
. ' value="'
. htmlspecialchars($plugin->getTranslatedText(self::getDefault(
$section,
$pluginName . '_' . $propertyItem->getName(),
)))
. '"></li>';
break;
case MessageOnlyPropertyItem::class:
$ret .= '<li class="list-group-item">' . "\n";
$ret .= $plugin->getTranslatedText($propertyItem->getText() ?? '');
break;
case RadioPropertyItem::class:
/** @var RadioPropertyItem $pitem */
$pitem = $propertyItem;
$default = htmlspecialchars($plugin->getTranslatedText(self::getDefault(
$section,
$pluginName . '_' . $pitem->getName(),
)));
$ret .= '<li class="list-group-item">';
foreach ($pitem->getValues() as $key => $val) {
$ret .= '<div class="form-check"><input type="radio" name="' . $pluginName
. '_' . $pitem->getName() . '" class="form-check-input" value="' . $key
. '" id="radio_' . $pluginName . '_'
. $pitem->getName() . '_' . $key . '"';
if ($key == $default) {
$ret .= ' checked';
}
$ret .= '><label class="form-check-label" for="radio_' . $pluginName . '_'
. $pitem->getName() . '_' . $key . '">'
. $plugin->getTranslatedText((string) $val) . '</label></div>';
}
$ret .= '</li>';
break;
case SelectPropertyItem::class:
/** @var SelectPropertyItem $pitem */
$pitem = $propertyItem;
$ret .= '<li class="list-group-item">' . "\n";
$ret .= '<label for="select_' . $pluginName . '_'
. $pitem->getName() . '" class="form-label">'
. $plugin->getTranslatedText($pitem->getText() ?? '') . '</label>';
$ret .= '<select class="form-select" name="' . $pluginName . '_'
. $pitem->getName() . '"'
. ' id="select_' . $pluginName . '_'
. $pitem->getName() . '">';
$default = htmlspecialchars($plugin->getTranslatedText(self::getDefault(
$section,
$pluginName . '_' . $pitem->getName(),
)));
foreach ($pitem->getValues() as $key => $val) {
$ret .= '<option value="' . $key . '"';
if ($key == $default) {
$ret .= ' selected';
}
$ret .= '>' . $plugin->getTranslatedText((string) $val) . '</option>';
}
$ret .= '</select>';
break;
case TextPropertyItem::class:
/** @var TextPropertyItem $pitem */
$pitem = $propertyItem;
$ret .= '<li class="list-group-item">' . "\n";
$ret .= '<label for="text_' . $pluginName . '_'
. $pitem->getName() . '" class="form-label">'
. $plugin->getTranslatedText($pitem->getText() ?? '') . '</label>';
$ret .= '<input class="form-control" type="text" name="' . $pluginName . '_'
. $pitem->getName() . '"'
. ' value="'
. htmlspecialchars($plugin->getTranslatedText(self::getDefault(
$section,
$pluginName . '_' . $pitem->getName(),
))) . '"'
. ' id="text_' . $pluginName . '_'
. $pitem->getName() . '"'
. ($pitem->getSize() !== 0
? ' size="' . $pitem->getSize() . '"'
: '')
. ($pitem->getLen() !== 0
? ' maxlength="' . $pitem->getLen() . '"'
: '')
. '>';
break;
case NumberPropertyItem::class:
$ret .= '<li class="list-group-item">' . "\n";
$ret .= '<label for="number_' . $pluginName . '_'
. $propertyItem->getName() . '" class="form-label">'
. $plugin->getTranslatedText($propertyItem->getText() ?? '') . '</label>';
$ret .= '<input class="form-control" type="number" name="' . $pluginName . '_'
. $propertyItem->getName() . '"'
. ' value="'
. htmlspecialchars($plugin->getTranslatedText(self::getDefault(
$section,
$pluginName . '_' . $propertyItem->getName(),
))) . '"'
. ' id="number_' . $pluginName . '_'
. $propertyItem->getName() . '"'
. ' min="0"'
. '>';
break;
default:
break;
$ret .= '</ul></div>' . "\n";
}
return $ret;
}
private static function getHtmlForProperty(
Plugin $plugin,
PluginType $pluginType,
string $pluginName,
OptionsPropertyItem $propertyItem,
): string {
if ($propertyItem instanceof OptionsPropertyOneItem) {
return $propertyItem->getHtml($plugin, $pluginType, $pluginName) . "\n";
}
return '';
}
/**
* Returns html div with editable options for plugin
*
* @param string $section name of config section in $cfg[$section]
* @param ExportPlugin[]|ImportPlugin[]|SchemaPlugin[] $list array with plugin instances
* @psalm-param 'Export'|'Import'|'Schema' $section
* @param ExportPlugin[]|ImportPlugin[]|SchemaPlugin[] $list array with plugin instances
*
* @return string html fieldset with plugin options
*/
public static function getOptions(string $section, array $list): string
public static function getOptions(PluginType $pluginType, array $list): string
{
$ret = '';
// Options for plugins that support them
@ -592,7 +397,7 @@ class Plugins
}
}
$ret .= self::getOneOption($plugin, $section, $pluginName, $propertyMainGroup);
$ret .= self::getOneOption($plugin, $pluginType, $pluginName, $propertyMainGroup);
}
}
@ -605,4 +410,22 @@ class Plugins
return $ret;
}
public static function getDocumentationLinkHtml(OptionsPropertyOneItem $propertyGroup): string
{
$doc = $propertyGroup->getDoc();
if ($doc === '') {
return '';
}
if (is_string($doc)) {
return MySQLDocumentation::showDocumentation('faq', $doc);
}
if (count($doc) === 2) {
return MySQLDocumentation::show($doc[0], anchor: $doc[1]);
}
return MySQLDocumentation::show($doc[0]);
}
}

View File

@ -223,7 +223,7 @@ class ExportSql extends ExportPlugin
__('Enclose export in a transaction'),
);
$leaf->setDoc(
['programs', 'mysqldump', 'option_mysqldump_single-transaction'],
['mysqldump', 'option_mysqldump_single-transaction'],
);
$generalOptions->addProperty($leaf);
@ -233,7 +233,7 @@ class ExportSql extends ExportPlugin
__('Disable foreign key checks'),
);
$leaf->setDoc(
['manual_MySQL_Database_Administration', 'server-system-variables', 'sysvar_foreign_key_checks'],
['server-system-variables', 'sysvar_foreign_key_checks'],
);
$generalOptions->addProperty($leaf);
@ -433,7 +433,7 @@ class ExportSql extends ExportPlugin
__('<code>INSERT DELAYED</code> statements'),
);
$leaf->setDoc(
['manual_MySQL_Database_Administration', 'insert_delayed'],
['insert_delayed'],
);
$subgroup->addProperty($leaf);
@ -442,7 +442,7 @@ class ExportSql extends ExportPlugin
__('<code>INSERT IGNORE</code> statements'),
);
$leaf->setDoc(
['manual_MySQL_Database_Administration', 'insert'],
['insert'],
);
$subgroup->addProperty($leaf);
$dataOptions->addProperty($subgroup);
@ -2572,7 +2572,7 @@ class ExportSql extends ExportPlugin
);
$leaf->setValues($values);
$leaf->setDoc(
['manual_MySQL_Database_Administration', 'Server_SQL_mode'],
['sql-mode'],
);
$generalOptions->addProperty($leaf);
}

View File

@ -63,7 +63,7 @@ class ImportSql extends ImportPlugin
);
$leaf->setValues($values);
$leaf->setDoc(
['manual_MySQL_Database_Administration', 'Server_SQL_mode'],
['sql-mode'],
);
$generalOptions->addProperty($leaf);
$leaf = new BoolPropertyItem(
@ -71,7 +71,7 @@ class ImportSql extends ImportPlugin
__('Do not use <code>AUTO_INCREMENT</code> for zero values'),
);
$leaf->setDoc(
['manual_MySQL_Database_Administration', 'Server_SQL_mode', 'sqlmode_no_auto_value_on_zero'],
['sql-mode', 'sqlmode_no_auto_value_on_zero'],
);
$generalOptions->addProperty($leaf);

View File

@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace PhpMyAdmin\Plugins;
enum PluginType: string
{
case Export = 'Export';
case Import = 'Import';
case Schema = 'Schema';
}

View File

@ -77,7 +77,7 @@ abstract class SchemaPlugin implements Plugin
/**
* Returns the array of paper sizes
*
* @return mixed[] array of paper sizes
* @return string[] array of paper sizes
*/
protected function getPaperSizeArray(): array
{

View File

@ -4,6 +4,9 @@ declare(strict_types=1);
namespace PhpMyAdmin\Properties\Options\Items;
use PhpMyAdmin\Plugins;
use PhpMyAdmin\Plugins\Plugin;
use PhpMyAdmin\Plugins\PluginType;
use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem;
/**
@ -11,4 +14,36 @@ use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem;
*/
class BoolPropertyItem extends OptionsPropertyOneItem
{
public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string
{
$ret = '<li class="list-group-item">';
$ret .= '<div class="form-check form-switch">';
$ret .= '<input class="form-check-input" type="checkbox" role="switch" name="' . $pluginName . '_'
. $this->getName() . '"'
. ' value="y" id="checkbox_' . $pluginName . '_'
. $this->getName() . '"'
. ' '
. Plugins::checkboxCheck(
$pluginType,
$pluginName . '_' . $this->getName(),
);
if ($this->getForce() !== null) {
$ret .= ' onclick="if (!this.checked &amp;&amp; '
. '(!document.getElementById(\'checkbox_' . $pluginName
. '_' . $this->getForce() . '\') '
. '|| !document.getElementById(\'checkbox_'
. $pluginName . '_' . $this->getForce()
. '\').checked)) '
. 'return false; else return true;"';
}
$ret .= '>';
$ret .= '<label class="form-check-label" for="checkbox_' . $pluginName . '_'
. $this->getName() . '">'
. $plugin->getTranslatedText($this->getText() ?? '') . '</label></div>';
$ret .= Plugins::getDocumentationLinkHtml($this);
return $ret;
}
}

View File

@ -1,14 +0,0 @@
<?php
declare(strict_types=1);
namespace PhpMyAdmin\Properties\Options\Items;
use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem;
/**
* Single property item class of type doc
*/
class DocPropertyItem extends OptionsPropertyOneItem
{
}

View File

@ -4,11 +4,27 @@ declare(strict_types=1);
namespace PhpMyAdmin\Properties\Options\Items;
use PhpMyAdmin\Plugins;
use PhpMyAdmin\Plugins\Plugin;
use PhpMyAdmin\Plugins\PluginType;
use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem;
use function htmlspecialchars;
/**
* Single property item class of type hidden
*/
class HiddenPropertyItem extends OptionsPropertyOneItem
{
public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string
{
return '<li class="list-group-item"><input type="hidden" name="' . $pluginName . '_'
. $this->getName() . '"'
. ' value="'
. htmlspecialchars($plugin->getTranslatedText(Plugins::getDefault(
$pluginType,
$pluginName . '_' . $this->getName(),
)))
. '">';
}
}

View File

@ -4,6 +4,9 @@ declare(strict_types=1);
namespace PhpMyAdmin\Properties\Options\Items;
use PhpMyAdmin\Plugins;
use PhpMyAdmin\Plugins\Plugin;
use PhpMyAdmin\Plugins\PluginType;
use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem;
/**
@ -11,4 +14,12 @@ use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem;
*/
class MessageOnlyPropertyItem extends OptionsPropertyOneItem
{
public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string
{
$ret = '<li class="list-group-item">';
$ret .= $plugin->getTranslatedText($this->getText() ?? '');
$ret .= Plugins::getDocumentationLinkHtml($this);
return $ret;
}
}

View File

@ -4,11 +4,36 @@ declare(strict_types=1);
namespace PhpMyAdmin\Properties\Options\Items;
use PhpMyAdmin\Plugins;
use PhpMyAdmin\Plugins\Plugin;
use PhpMyAdmin\Plugins\PluginType;
use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem;
use function htmlspecialchars;
/**
* Single property item class of type number
*/
class NumberPropertyItem extends OptionsPropertyOneItem
{
public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string
{
$ret = '<li class="list-group-item">';
$ret .= '<label for="number_' . $pluginName . '_'
. $this->getName() . '" class="form-label">'
. $plugin->getTranslatedText($this->getText() ?? '') . '</label>';
$ret .= '<input class="form-control" type="number" name="' . $pluginName . '_'
. $this->getName() . '"'
. ' value="'
. htmlspecialchars($plugin->getTranslatedText(Plugins::getDefault(
$pluginType,
$pluginName . '_' . $this->getName(),
))) . '"'
. ' id="number_' . $pluginName . '_'
. $this->getName() . '"'
. ' min="0"'
. '>';
return $ret;
}
}

View File

@ -4,11 +4,41 @@ declare(strict_types=1);
namespace PhpMyAdmin\Properties\Options\Items;
use PhpMyAdmin\Plugins;
use PhpMyAdmin\Plugins\Plugin;
use PhpMyAdmin\Plugins\PluginType;
use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem;
use function htmlspecialchars;
/**
* Single property item class of type radio
*/
class RadioPropertyItem extends OptionsPropertyOneItem
{
public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string
{
$default = htmlspecialchars($plugin->getTranslatedText(Plugins::getDefault(
$pluginType,
$pluginName . '_' . $this->getName(),
)));
$ret = '<li class="list-group-item">';
foreach ($this->getValues() as $key => $val) {
$ret .= '<div class="form-check"><input type="radio" name="' . $pluginName
. '_' . $this->getName() . '" class="form-check-input" value="' . $key
. '" id="radio_' . $pluginName . '_'
. $this->getName() . '_' . $key . '"';
if ($key == $default) {
$ret .= ' checked';
}
$ret .= '><label class="form-check-label" for="radio_' . $pluginName . '_'
. $this->getName() . '_' . $key . '">'
. $plugin->getTranslatedText($val) . '</label></div>';
}
return $ret;
}
}

View File

@ -4,11 +4,44 @@ declare(strict_types=1);
namespace PhpMyAdmin\Properties\Options\Items;
use PhpMyAdmin\Plugins;
use PhpMyAdmin\Plugins\Plugin;
use PhpMyAdmin\Plugins\PluginType;
use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem;
use function htmlspecialchars;
/**
* Single property item class of type select
*/
class SelectPropertyItem extends OptionsPropertyOneItem
{
public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string
{
$ret = '<li class="list-group-item">';
$ret .= '<label for="select_' . $pluginName . '_'
. $this->getName() . '" class="form-label">'
. $plugin->getTranslatedText($this->getText() ?? '') . '</label>';
$ret .= '<select class="form-select" name="' . $pluginName . '_'
. $this->getName() . '"'
. ' id="select_' . $pluginName . '_'
. $this->getName() . '">';
$default = htmlspecialchars($plugin->getTranslatedText(Plugins::getDefault(
$pluginType,
$pluginName . '_' . $this->getName(),
)));
foreach ($this->getValues() as $key => $val) {
$ret .= '<option value="' . $key . '"';
if ($key == $default) {
$ret .= ' selected';
}
$ret .= '>' . $plugin->getTranslatedText($val) . '</option>';
}
$ret .= '</select>';
$ret .= Plugins::getDocumentationLinkHtml($this);
return $ret;
}
}

View File

@ -4,11 +4,42 @@ declare(strict_types=1);
namespace PhpMyAdmin\Properties\Options\Items;
use PhpMyAdmin\Plugins;
use PhpMyAdmin\Plugins\Plugin;
use PhpMyAdmin\Plugins\PluginType;
use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem;
use function htmlspecialchars;
/**
* Single property item class of type text
*/
class TextPropertyItem extends OptionsPropertyOneItem
{
public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string
{
$ret = '<li class="list-group-item">';
$ret .= '<label for="text_' . $pluginName . '_'
. $this->getName() . '" class="form-label">'
. $plugin->getTranslatedText($this->getText() ?? '') . '</label>';
$ret .= '<input class="form-control" type="text" name="' . $pluginName . '_'
. $this->getName() . '"'
. ' value="'
. htmlspecialchars($plugin->getTranslatedText(Plugins::getDefault(
$pluginType,
$pluginName . '_' . $this->getName(),
))) . '"'
. ' id="text_' . $pluginName . '_'
. $this->getName() . '"'
. ($this->getSize() !== 0
? ' size="' . $this->getSize() . '"'
: '')
. ($this->getLen() !== 0
? ' maxlength="' . $this->getLen() . '"'
: '')
. '>';
$ret .= Plugins::getDocumentationLinkHtml($this);
return $ret;
}
}

View File

@ -7,13 +7,16 @@ declare(strict_types=1);
namespace PhpMyAdmin\Properties\Options;
use PhpMyAdmin\Plugins\Plugin;
use PhpMyAdmin\Plugins\PluginType;
/**
* Parents only single property items (not groups).
* Defines possible options and getters and setters for them.
*/
abstract class OptionsPropertyOneItem extends OptionsPropertyItem
{
/** @var mixed[] */
/** @var string[] */
private array $values = [];
/** @var string|string[] */
@ -27,7 +30,7 @@ abstract class OptionsPropertyOneItem extends OptionsPropertyItem
/**
* Gets the values
*
* @return mixed[]
* @return string[]
*/
public function getValues(): array
{
@ -37,7 +40,7 @@ abstract class OptionsPropertyOneItem extends OptionsPropertyItem
/**
* Sets the values
*
* @param mixed[] $values values
* @param string[] $values values
*/
public function setValues(array $values): void
{
@ -83,4 +86,6 @@ abstract class OptionsPropertyOneItem extends OptionsPropertyItem
{
$this->size = $size;
}
abstract public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string;
}

View File

@ -193,8 +193,7 @@ class Util
}
}
$url = 'https://dev.mysql.com/doc/refman/'
. $mysql . '/' . $lang . '/' . $link . '.html';
$url = 'https://dev.mysql.com/doc/refman/' . $mysql . '/' . $lang . '/' . $link . '.html';
if ($anchor !== '') {
$url .= '#' . $anchor;
}

View File

@ -21,6 +21,7 @@ use PhpMyAdmin\Http\ServerRequest;
use PhpMyAdmin\I18n\LanguageManager;
use PhpMyAdmin\Plugins;
use PhpMyAdmin\Plugins\ExportType;
use PhpMyAdmin\Plugins\PluginType;
use PhpMyAdmin\Template;
use PhpMyAdmin\Tests\AbstractTestCase;
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
@ -75,7 +76,7 @@ class ExportControllerTest extends AbstractTestCase
],
'export_method' => 'quick',
'plugins_choice' => Plugins::getChoice($exportList, 'sql'),
'options' => Plugins::getOptions('Export', $exportList),
'options' => Plugins::getOptions(PluginType::Export, $exportList),
'can_convert_kanji' => false,
'exec_time_limit' => 300,
'rows' => [

View File

@ -19,6 +19,7 @@ use PhpMyAdmin\Http\Factory\ServerRequestFactory;
use PhpMyAdmin\Import\ImportSettings;
use PhpMyAdmin\Plugins;
use PhpMyAdmin\Plugins\Import\Upload\UploadNoplugin;
use PhpMyAdmin\Plugins\PluginType;
use PhpMyAdmin\Template;
use PhpMyAdmin\Tests\AbstractTestCase;
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
@ -48,7 +49,7 @@ class ImportControllerTest extends AbstractTestCase
ImportSettings::$importType = 'table';
$importList = Plugins::getImport();
$choice = Plugins::getChoice($importList, 'xml');
$options = Plugins::getOptions('Import', $importList);
$options = Plugins::getOptions(PluginType::Import, $importList);
$template = new Template($config);
$userPreferences = new UserPreferences($dbi, new Relation($dbi, $config), $template, $config, new Clock());

View File

@ -18,6 +18,7 @@ use PhpMyAdmin\Export\TemplateModel;
use PhpMyAdmin\I18n\LanguageManager;
use PhpMyAdmin\Plugins;
use PhpMyAdmin\Plugins\ExportType;
use PhpMyAdmin\Plugins\PluginType;
use PhpMyAdmin\Template;
use PhpMyAdmin\Tests\AbstractTestCase;
use PhpMyAdmin\Theme\ThemeManager;
@ -110,7 +111,7 @@ class OptionsTest extends AbstractTestCase
],
'export_method' => $config->config->Export->method,
'plugins_choice' => $dropdown,
'options' => Plugins::getOptions('Export', $exportList),
'options' => Plugins::getOptions(PluginType::Export, $exportList),
'can_convert_kanji' => Encoding::canConvertKanji(),
'exec_time_limit' => $config->settings['ExecTimeLimit'],
'rows' => [],

View File

@ -20,6 +20,7 @@ use PhpMyAdmin\Plugins\ExportPlugin;
use PhpMyAdmin\Plugins\ExportType;
use PhpMyAdmin\Plugins\Import\ImportSql;
use PhpMyAdmin\Plugins\ImportPlugin;
use PhpMyAdmin\Plugins\PluginType;
use PhpMyAdmin\Plugins\Schema\SchemaPdf;
use PhpMyAdmin\Plugins\SchemaPlugin;
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
@ -66,13 +67,12 @@ class PluginsTest extends AbstractTestCase
self::assertContainsOnlyInstancesOf(SchemaPlugin::class, $plugins);
}
/** @psalm-param 'Export'|'Import'|'Schema' $section */
#[DataProvider('providerForTestGetDefault')]
public function testGetDefault(
string $expected,
string|int|null $actualConfig,
string|null $actualGet,
string $section,
PluginType $pluginType,
string $option,
bool|null $timeoutPassed,
): void {
@ -85,30 +85,30 @@ class PluginsTest extends AbstractTestCase
$_GET[$option] = $actualGet;
}
Config::getInstance()->settings[$section][$option] = $actualConfig;
$default = Plugins::getDefault($section, $option);
Config::getInstance()->settings[$pluginType->value][$option] = $actualConfig;
$default = Plugins::getDefault($pluginType, $option);
self::assertSame($expected, $default);
}
/** @return array<array{string, string|int|null, string|null, 'Export'|'Import'|'Schema', string, bool|null}> */
/** @return array<array{string, string|int|null, string|null, PluginType, string, bool|null}> */
public static function providerForTestGetDefault(): array
{
return [
['xml', 'xml', null, 'Export', 'format', null],
['xml', 'sql', 'xml', 'Export', 'format', null],
['xml', null, 'xml', 'Export', 'format', null],
['', null, null, 'Export', 'format', null],
['xml', 'xml', null, PluginType::Export, 'format', null],
['xml', 'sql', 'xml', PluginType::Export, 'format', null],
['xml', null, 'xml', PluginType::Export, 'format', null],
['', null, null, PluginType::Export, 'format', null],
[
'strLatexStructure strTest strLatexContinued',
'strLatexStructure strTest strLatexContinued',
null,
'Export',
PluginType::Export,
'latex_structure_continued_caption',
null,
],
['xml', 'sql', 'xml', 'Export', 'format', true],
['sql', 'sql', 'xml', 'Export', 'format', false],
['30', 30, null, 'Import', 'skip_queries', null],
['xml', 'sql', 'xml', PluginType::Export, 'format', true],
['sql', 'sql', 'xml', PluginType::Export, 'format', false],
['30', 30, null, PluginType::Import, 'skip_queries', null],
];
}
@ -151,38 +151,35 @@ class PluginsTest extends AbstractTestCase
ContainerBuilder::$container = $this->getContainerForGetOptions($this->createDatabaseInterface($dbiDummy));
ImportSettings::$importType = 'table';
$options = Plugins::getOptions('Import', Plugins::getImport());
$options = Plugins::getOptions(PluginType::Import, Plugins::getImport());
$dbiDummy->assertAllQueriesConsumed();
// phpcs:disable Generic.Files.LineLength.TooLong
$expected = <<<'HTML'
<div id="csv_options" class="format_specific_options"><h3>CSV</h3>
<div id="csv_general_opts"><ul class="list-group"><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="csv_replace" value="y" id="checkbox_csv_replace" ><label class="form-check-label" for="checkbox_csv_replace">Update data when duplicate keys found on import (add ON DUPLICATE KEY UPDATE)</label></div><li class="list-group-item">
<label for="text_csv_terminated" class="form-label">Columns separated with:</label><input class="form-control" type="text" name="csv_terminated" value="," id="text_csv_terminated" size="2"><li class="list-group-item">
<label for="text_csv_enclosed" class="form-label">Columns enclosed with:</label><input class="form-control" type="text" name="csv_enclosed" value="&quot;" id="text_csv_enclosed" size="2" maxlength="2"><li class="list-group-item">
<label for="text_csv_escaped" class="form-label">Columns escaped with:</label><input class="form-control" type="text" name="csv_escaped" value="&quot;" id="text_csv_escaped" size="2" maxlength="2"><li class="list-group-item">
<label for="text_csv_new_line" class="form-label">Lines terminated with:</label><input class="form-control" type="text" name="csv_new_line" value="auto" id="text_csv_new_line" size="2"><li class="list-group-item">
<label for="number_csv_partial_import" class="form-label">Import these many number of rows (optional):</label><input class="form-control" type="number" name="csv_partial_import" value="" id="number_csv_partial_import" min="0"><li class="list-group-item">
<label for="text_csv_columns" class="form-label">Column names: <span class="pma_hint"><img src="themes/dot.gif" title="" alt="" class="icon ic_b_help"><span class="hide">If the data in each row of the file is not in the same order as in the database, list the corresponding column names here. Column names must be separated by commas and not enclosed in quotations.</span></span></label><input class="form-control" type="text" name="csv_columns" value="" id="text_csv_columns"><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="csv_ignore" value="y" id="checkbox_csv_ignore" ><label class="form-check-label" for="checkbox_csv_ignore">Do not abort on INSERT error</label></div></ul></div></li>
<div id="csv_general_opts"><ul class="list-group">
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="csv_replace" value="y" id="checkbox_csv_replace" ><label class="form-check-label" for="checkbox_csv_replace">Update data when duplicate keys found on import (add ON DUPLICATE KEY UPDATE)</label></div>
<li class="list-group-item"><label for="text_csv_terminated" class="form-label">Columns separated with:</label><input class="form-control" type="text" name="csv_terminated" value="," id="text_csv_terminated" size="2">
<li class="list-group-item"><label for="text_csv_enclosed" class="form-label">Columns enclosed with:</label><input class="form-control" type="text" name="csv_enclosed" value="&quot;" id="text_csv_enclosed" size="2" maxlength="2">
<li class="list-group-item"><label for="text_csv_escaped" class="form-label">Columns escaped with:</label><input class="form-control" type="text" name="csv_escaped" value="&quot;" id="text_csv_escaped" size="2" maxlength="2">
<li class="list-group-item"><label for="text_csv_new_line" class="form-label">Lines terminated with:</label><input class="form-control" type="text" name="csv_new_line" value="auto" id="text_csv_new_line" size="2">
<li class="list-group-item"><label for="number_csv_partial_import" class="form-label">Import these many number of rows (optional):</label><input class="form-control" type="number" name="csv_partial_import" value="" id="number_csv_partial_import" min="0">
<li class="list-group-item"><label for="text_csv_columns" class="form-label">Column names: <span class="pma_hint"><img src="themes/dot.gif" title="" alt="" class="icon ic_b_help"><span class="hide">If the data in each row of the file is not in the same order as in the database, list the corresponding column names here. Column names must be separated by commas and not enclosed in quotations.</span></span></label><input class="form-control" type="text" name="csv_columns" value="" id="text_csv_columns">
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="csv_ignore" value="y" id="checkbox_csv_ignore" ><label class="form-check-label" for="checkbox_csv_ignore">Do not abort on INSERT error</label></div>
</ul></div>
</div>
<div id="ldi_options" class="format_specific_options"><h3>CSV using LOAD DATA</h3>
<div id="ldi_general_opts"><ul class="list-group"><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="ldi_replace" value="y" id="checkbox_ldi_replace" ><label class="form-check-label" for="checkbox_ldi_replace">Update data when duplicate keys found on import (add ON DUPLICATE KEY UPDATE)</label></div><li class="list-group-item">
<label for="text_ldi_terminated" class="form-label">Columns separated with:</label><input class="form-control" type="text" name="ldi_terminated" value=";" id="text_ldi_terminated" size="2"><li class="list-group-item">
<label for="text_ldi_enclosed" class="form-label">Columns enclosed with:</label><input class="form-control" type="text" name="ldi_enclosed" value="&quot;" id="text_ldi_enclosed" size="2" maxlength="2"><li class="list-group-item">
<label for="text_ldi_escaped" class="form-label">Columns escaped with:</label><input class="form-control" type="text" name="ldi_escaped" value="\" id="text_ldi_escaped" size="2" maxlength="2"><li class="list-group-item">
<label for="text_ldi_new_line" class="form-label">Lines terminated with:</label><input class="form-control" type="text" name="ldi_new_line" value="auto" id="text_ldi_new_line" size="2"><li class="list-group-item">
<label for="text_ldi_columns" class="form-label">Column names: </label><input class="form-control" type="text" name="ldi_columns" value="" id="text_ldi_columns"><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="ldi_ignore" value="y" id="checkbox_ldi_ignore" ><label class="form-check-label" for="checkbox_ldi_ignore">Do not abort on INSERT error</label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="ldi_local_option" value="y" id="checkbox_ldi_local_option" checked><label class="form-check-label" for="checkbox_ldi_local_option">Use LOCAL keyword</label></div></ul></div></li>
<div id="ldi_general_opts"><ul class="list-group">
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="ldi_replace" value="y" id="checkbox_ldi_replace" ><label class="form-check-label" for="checkbox_ldi_replace">Update data when duplicate keys found on import (add ON DUPLICATE KEY UPDATE)</label></div>
<li class="list-group-item"><label for="text_ldi_terminated" class="form-label">Columns separated with:</label><input class="form-control" type="text" name="ldi_terminated" value=";" id="text_ldi_terminated" size="2">
<li class="list-group-item"><label for="text_ldi_enclosed" class="form-label">Columns enclosed with:</label><input class="form-control" type="text" name="ldi_enclosed" value="&quot;" id="text_ldi_enclosed" size="2" maxlength="2">
<li class="list-group-item"><label for="text_ldi_escaped" class="form-label">Columns escaped with:</label><input class="form-control" type="text" name="ldi_escaped" value="\" id="text_ldi_escaped" size="2" maxlength="2">
<li class="list-group-item"><label for="text_ldi_new_line" class="form-label">Lines terminated with:</label><input class="form-control" type="text" name="ldi_new_line" value="auto" id="text_ldi_new_line" size="2">
<li class="list-group-item"><label for="text_ldi_columns" class="form-label">Column names: </label><input class="form-control" type="text" name="ldi_columns" value="" id="text_ldi_columns">
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="ldi_ignore" value="y" id="checkbox_ldi_ignore" ><label class="form-check-label" for="checkbox_ldi_ignore">Do not abort on INSERT error</label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="ldi_local_option" value="y" id="checkbox_ldi_local_option" checked><label class="form-check-label" for="checkbox_ldi_local_option">Use LOCAL keyword</label></div>
</ul></div>
</div>
<div id="shp_options" class="format_specific_options"><h3>ESRI Shape File</h3><p class="card-text">This format has no options</p></div>
@ -190,22 +187,19 @@ class PluginsTest extends AbstractTestCase
<div id="mediawiki_options" class="format_specific_options"><h3>MediaWiki Table</h3><p class="card-text">This format has no options</p></div>
<div id="ods_options" class="format_specific_options"><h3>OpenDocument Spreadsheet</h3>
<div id="ods_general_opts"><ul class="list-group"><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="ods_col_names" value="y" id="checkbox_ods_col_names" ><label class="form-check-label" for="checkbox_ods_col_names">The first line of the file contains the table column names <i>(if this is unchecked, the first line will become part of the data)</i></label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="ods_empty_rows" value="y" id="checkbox_ods_empty_rows" checked><label class="form-check-label" for="checkbox_ods_empty_rows">Do not import empty rows</label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="ods_recognize_percentages" value="y" id="checkbox_ods_recognize_percentages" checked><label class="form-check-label" for="checkbox_ods_recognize_percentages">Import percentages as proper decimals <i>(ex. 12.00% to .12)</i></label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="ods_recognize_currency" value="y" id="checkbox_ods_recognize_currency" checked><label class="form-check-label" for="checkbox_ods_recognize_currency">Import currencies <i>(ex. $5.00 to 5.00)</i></label></div></ul></div></li>
<div id="ods_general_opts"><ul class="list-group">
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="ods_col_names" value="y" id="checkbox_ods_col_names" ><label class="form-check-label" for="checkbox_ods_col_names">The first line of the file contains the table column names <i>(if this is unchecked, the first line will become part of the data)</i></label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="ods_empty_rows" value="y" id="checkbox_ods_empty_rows" checked><label class="form-check-label" for="checkbox_ods_empty_rows">Do not import empty rows</label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="ods_recognize_percentages" value="y" id="checkbox_ods_recognize_percentages" checked><label class="form-check-label" for="checkbox_ods_recognize_percentages">Import percentages as proper decimals <i>(ex. 12.00% to .12)</i></label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="ods_recognize_currency" value="y" id="checkbox_ods_recognize_currency" checked><label class="form-check-label" for="checkbox_ods_recognize_currency">Import currencies <i>(ex. $5.00 to 5.00)</i></label></div>
</ul></div>
</div>
<div id="sql_options" class="format_specific_options"><h3>SQL</h3>
<div id="sql_general_opts"><ul class="list-group"><li class="list-group-item">
<label for="select_sql_compatibility" class="form-label">SQL compatibility mode:</label><select class="form-select" name="sql_compatibility" id="select_sql_compatibility"><option value="NONE" selected>NONE</option><option value="ANSI">ANSI</option><option value="DB2">DB2</option><option value="MAXDB">MAXDB</option><option value="MYSQL323">MYSQL323</option><option value="MYSQL40">MYSQL40</option><option value="MSSQL">MSSQL</option><option value="ORACLE">ORACLE</option><option value="TRADITIONAL">TRADITIONAL</option></select><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_no_auto_value_on_zero" value="y" id="checkbox_sql_no_auto_value_on_zero" checked><label class="form-check-label" for="checkbox_sql_no_auto_value_on_zero">Do not use <code>AUTO_INCREMENT</code> for zero values</label></div></ul></div></li>
<div id="sql_general_opts"><ul class="list-group">
<li class="list-group-item"><label for="select_sql_compatibility" class="form-label">SQL compatibility mode:</label><select class="form-select" name="sql_compatibility" id="select_sql_compatibility"><option value="NONE" selected>NONE</option><option value="ANSI">ANSI</option><option value="DB2">DB2</option><option value="MAXDB">MAXDB</option><option value="MYSQL323">MYSQL323</option><option value="MYSQL40">MYSQL40</option><option value="MSSQL">MSSQL</option><option value="ORACLE">ORACLE</option><option value="TRADITIONAL">TRADITIONAL</option></select><a href="index.php?route=/url&url=https%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.7%2Fen%2Fsql-mode.html" target="mysql_doc"><img src="themes/dot.gif" title="Documentation" alt="Documentation" class="icon ic_b_help"></a>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_no_auto_value_on_zero" value="y" id="checkbox_sql_no_auto_value_on_zero" checked><label class="form-check-label" for="checkbox_sql_no_auto_value_on_zero">Do not use <code>AUTO_INCREMENT</code> for zero values</label></div><a href="index.php?route=/url&url=https%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.7%2Fen%2Fsql-mode.html%23sqlmode_no_auto_value_on_zero" target="mysql_doc"><img src="themes/dot.gif" title="Documentation" alt="Documentation" class="icon ic_b_help"></a>
</ul></div>
</div>
<div id="xml_options" class="format_specific_options"><h3>XML</h3><p class="card-text">This format has no options</p></div>
@ -221,225 +215,212 @@ class PluginsTest extends AbstractTestCase
{
ContainerBuilder::$container = $this->getContainerForGetOptions($this->createDatabaseInterface());
$options = Plugins::getOptions('Export', Plugins::getExport(ExportType::Table, true));
$options = Plugins::getOptions(PluginType::Export, Plugins::getExport(ExportType::Table, true));
// phpcs:disable Generic.Files.LineLength.TooLong
$expected = <<<'HTML'
<div id="codegen_options" class="format_specific_options"><h3>CodeGen</h3>
<div id="codegen_general_opts"><ul class="list-group"><li class="list-group-item"><input type="hidden" name="codegen_structure_or_data" value="data"></li><li class="list-group-item">
<label for="select_codegen_format" class="form-label">Format:</label><select class="form-select" name="codegen_format" id="select_codegen_format"><option value="0" selected>NHibernate C# DO</option><option value="1">NHibernate XML</option></select></ul></div></li>
<div id="codegen_general_opts"><ul class="list-group">
<li class="list-group-item"><input type="hidden" name="codegen_structure_or_data" value="data">
<li class="list-group-item"><label for="select_codegen_format" class="form-label">Format:</label><select class="form-select" name="codegen_format" id="select_codegen_format"><option value="0" selected>NHibernate C# DO</option><option value="1">NHibernate XML</option></select>
</ul></div>
</div>
<div id="csv_options" class="format_specific_options"><h3>CSV</h3>
<div id="csv_general_opts"><ul class="list-group"><li class="list-group-item">
<label for="text_csv_separator" class="form-label">Columns separated with:</label><input class="form-control" type="text" name="csv_separator" value="," id="text_csv_separator"><li class="list-group-item">
<label for="text_csv_enclosed" class="form-label">Columns enclosed with:</label><input class="form-control" type="text" name="csv_enclosed" value="&quot;" id="text_csv_enclosed"><li class="list-group-item">
<label for="text_csv_escaped" class="form-label">Columns escaped with:</label><input class="form-control" type="text" name="csv_escaped" value="&quot;" id="text_csv_escaped"><li class="list-group-item">
<label for="text_csv_terminated" class="form-label">Lines terminated with:</label><input class="form-control" type="text" name="csv_terminated" value="AUTO" id="text_csv_terminated"><li class="list-group-item">
<label for="text_csv_null" class="form-label">Replace NULL with:</label><input class="form-control" type="text" name="csv_null" value="NULL" id="text_csv_null"><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="csv_removeCRLF" value="y" id="checkbox_csv_removeCRLF" ><label class="form-check-label" for="checkbox_csv_removeCRLF">Remove carriage return/line feed characters within columns</label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="csv_columns" value="y" id="checkbox_csv_columns" checked><label class="form-check-label" for="checkbox_csv_columns">Put columns names in the first row</label></div><li class="list-group-item"><input type="hidden" name="csv_structure_or_data" value="data"></li></ul></div>
<div id="csv_general_opts"><ul class="list-group">
<li class="list-group-item"><label for="text_csv_separator" class="form-label">Columns separated with:</label><input class="form-control" type="text" name="csv_separator" value="," id="text_csv_separator">
<li class="list-group-item"><label for="text_csv_enclosed" class="form-label">Columns enclosed with:</label><input class="form-control" type="text" name="csv_enclosed" value="&quot;" id="text_csv_enclosed">
<li class="list-group-item"><label for="text_csv_escaped" class="form-label">Columns escaped with:</label><input class="form-control" type="text" name="csv_escaped" value="&quot;" id="text_csv_escaped">
<li class="list-group-item"><label for="text_csv_terminated" class="form-label">Lines terminated with:</label><input class="form-control" type="text" name="csv_terminated" value="AUTO" id="text_csv_terminated">
<li class="list-group-item"><label for="text_csv_null" class="form-label">Replace NULL with:</label><input class="form-control" type="text" name="csv_null" value="NULL" id="text_csv_null">
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="csv_removeCRLF" value="y" id="checkbox_csv_removeCRLF" ><label class="form-check-label" for="checkbox_csv_removeCRLF">Remove carriage return/line feed characters within columns</label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="csv_columns" value="y" id="checkbox_csv_columns" checked><label class="form-check-label" for="checkbox_csv_columns">Put columns names in the first row</label></div>
<li class="list-group-item"><input type="hidden" name="csv_structure_or_data" value="data">
</ul></div>
</div>
<div id="excel_options" class="format_specific_options"><h3>CSV for MS Excel</h3>
<div id="excel_general_opts"><ul class="list-group"><li class="list-group-item">
<label for="text_excel_null" class="form-label">Replace NULL with:</label><input class="form-control" type="text" name="excel_null" value="NULL" id="text_excel_null"><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="excel_removeCRLF" value="y" id="checkbox_excel_removeCRLF" ><label class="form-check-label" for="checkbox_excel_removeCRLF">Remove carriage return/line feed characters within columns</label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="excel_columns" value="y" id="checkbox_excel_columns" checked><label class="form-check-label" for="checkbox_excel_columns">Put columns names in the first row</label></div><li class="list-group-item">
<label for="select_excel_edition" class="form-label">Excel edition:</label><select class="form-select" name="excel_edition" id="select_excel_edition"><option value="win" selected>Windows</option><option value="mac_excel2003">Excel 2003 / Macintosh</option><option value="mac_excel2008">Excel 2008 / Macintosh</option></select><li class="list-group-item"><input type="hidden" name="excel_structure_or_data" value="data"></li></ul></div>
<div id="excel_general_opts"><ul class="list-group">
<li class="list-group-item"><label for="text_excel_null" class="form-label">Replace NULL with:</label><input class="form-control" type="text" name="excel_null" value="NULL" id="text_excel_null">
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="excel_removeCRLF" value="y" id="checkbox_excel_removeCRLF" ><label class="form-check-label" for="checkbox_excel_removeCRLF">Remove carriage return/line feed characters within columns</label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="excel_columns" value="y" id="checkbox_excel_columns" checked><label class="form-check-label" for="checkbox_excel_columns">Put columns names in the first row</label></div>
<li class="list-group-item"><label for="select_excel_edition" class="form-label">Excel edition:</label><select class="form-select" name="excel_edition" id="select_excel_edition"><option value="win" selected>Windows</option><option value="mac_excel2003">Excel 2003 / Macintosh</option><option value="mac_excel2008">Excel 2008 / Macintosh</option></select>
<li class="list-group-item"><input type="hidden" name="excel_structure_or_data" value="data">
</ul></div>
</div>
<div id="json_options" class="format_specific_options"><h3>JSON</h3>
<div id="json_general_opts"><ul class="list-group"><li class="list-group-item"><input type="hidden" name="json_structure_or_data" value="data"></li><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="json_pretty_print" value="y" id="checkbox_json_pretty_print" ><label class="form-check-label" for="checkbox_json_pretty_print">Output pretty-printed JSON (Use human-readable formatting)</label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="json_unicode" value="y" id="checkbox_json_unicode" checked><label class="form-check-label" for="checkbox_json_unicode">Output unicode characters unescaped</label></div></ul></div></li>
<div id="json_general_opts"><ul class="list-group">
<li class="list-group-item"><input type="hidden" name="json_structure_or_data" value="data">
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="json_pretty_print" value="y" id="checkbox_json_pretty_print" ><label class="form-check-label" for="checkbox_json_pretty_print">Output pretty-printed JSON (Use human-readable formatting)</label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="json_unicode" value="y" id="checkbox_json_unicode" checked><label class="form-check-label" for="checkbox_json_unicode">Output unicode characters unescaped</label></div>
</ul></div>
</div>
<div id="latex_options" class="format_specific_options"><h3>LaTeX</h3>
<div id="latex_general_opts"><ul class="list-group"><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="latex_caption" value="y" id="checkbox_latex_caption" checked><label class="form-check-label" for="checkbox_latex_caption">Include table caption</label></div></ul></div></li>
<div id="latex_general_opts"><ul class="list-group">
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="latex_caption" value="y" id="checkbox_latex_caption" checked><label class="form-check-label" for="checkbox_latex_caption">Include table caption</label></div>
</ul></div>
<div id="latex_dump_what"><h5 class="card-title mt-4 mb-2">Dump table</h5><ul class="list-group"><li class="list-group-item"><div class="form-check"><input type="radio" name="latex_structure_or_data" class="form-check-input" value="structure" id="radio_latex_structure_or_data_structure"><label class="form-check-label" for="radio_latex_structure_or_data_structure">structure</label></div><div class="form-check"><input type="radio" name="latex_structure_or_data" class="form-check-input" value="data" id="radio_latex_structure_or_data_data"><label class="form-check-label" for="radio_latex_structure_or_data_data">data</label></div><div class="form-check"><input type="radio" name="latex_structure_or_data" class="form-check-input" value="structure_and_data" id="radio_latex_structure_or_data_structure_and_data" checked><label class="form-check-label" for="radio_latex_structure_or_data_structure_and_data">structure and data</label></div></li></ul></div>
<div id="latex_dump_what"><h5 class="card-title mt-4 mb-2">Dump table</h5><ul class="list-group">
<li class="list-group-item"><div class="form-check"><input type="radio" name="latex_structure_or_data" class="form-check-input" value="structure" id="radio_latex_structure_or_data_structure"><label class="form-check-label" for="radio_latex_structure_or_data_structure">structure</label></div><div class="form-check"><input type="radio" name="latex_structure_or_data" class="form-check-input" value="data" id="radio_latex_structure_or_data_data"><label class="form-check-label" for="radio_latex_structure_or_data_data">data</label></div><div class="form-check"><input type="radio" name="latex_structure_or_data" class="form-check-input" value="structure_and_data" id="radio_latex_structure_or_data_structure_and_data" checked><label class="form-check-label" for="radio_latex_structure_or_data_structure_and_data">structure and data</label></div>
</ul></div>
<div id="latex_structure"><h5 class="card-title mt-4 mb-2">Object creation options</h5><ul class="list-group"><li class="list-group-item">
<label for="text_latex_structure_caption" class="form-label">Table caption:</label><input class="form-control" type="text" name="latex_structure_caption" value="Structure of table @TABLE@" id="text_latex_structure_caption"><li class="list-group-item">
<label for="text_latex_structure_continued_caption" class="form-label">Table caption (continued):</label><input class="form-control" type="text" name="latex_structure_continued_caption" value="Structure of table @TABLE@ (continued)" id="text_latex_structure_continued_caption"><li class="list-group-item">
<label for="text_latex_structure_label" class="form-label">Label key:</label><input class="form-control" type="text" name="latex_structure_label" value="tab:@TABLE@-structure" id="text_latex_structure_label"><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="latex_comments" value="y" id="checkbox_latex_comments" checked><label class="form-check-label" for="checkbox_latex_comments">Display comments</label></div></ul></div></li>
<div id="latex_structure"><h5 class="card-title mt-4 mb-2">Object creation options</h5><ul class="list-group">
<li class="list-group-item"><label for="text_latex_structure_caption" class="form-label">Table caption:</label><input class="form-control" type="text" name="latex_structure_caption" value="Structure of table @TABLE@" id="text_latex_structure_caption"><a href="index.php?route=/url&url=https%3A%2F%2Fdocs.phpmyadmin.net%2Fen%2Flatest%2Ffaq.html%23faq6-27" target="documentation"><img src="themes/dot.gif" title="Documentation" alt="Documentation" class="icon ic_b_help"></a>
<li class="list-group-item"><label for="text_latex_structure_continued_caption" class="form-label">Table caption (continued):</label><input class="form-control" type="text" name="latex_structure_continued_caption" value="Structure of table @TABLE@ (continued)" id="text_latex_structure_continued_caption"><a href="index.php?route=/url&url=https%3A%2F%2Fdocs.phpmyadmin.net%2Fen%2Flatest%2Ffaq.html%23faq6-27" target="documentation"><img src="themes/dot.gif" title="Documentation" alt="Documentation" class="icon ic_b_help"></a>
<li class="list-group-item"><label for="text_latex_structure_label" class="form-label">Label key:</label><input class="form-control" type="text" name="latex_structure_label" value="tab:@TABLE@-structure" id="text_latex_structure_label"><a href="index.php?route=/url&url=https%3A%2F%2Fdocs.phpmyadmin.net%2Fen%2Flatest%2Ffaq.html%23faq6-27" target="documentation"><img src="themes/dot.gif" title="Documentation" alt="Documentation" class="icon ic_b_help"></a>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="latex_comments" value="y" id="checkbox_latex_comments" checked><label class="form-check-label" for="checkbox_latex_comments">Display comments</label></div>
</ul></div>
<div id="latex_data"><h5 class="card-title mt-4 mb-2">Data dump options</h5><ul class="list-group"><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="latex_columns" value="y" id="checkbox_latex_columns" checked><label class="form-check-label" for="checkbox_latex_columns">Put columns names in the first row:</label></div><li class="list-group-item">
<label for="text_latex_data_caption" class="form-label">Table caption:</label><input class="form-control" type="text" name="latex_data_caption" value="Content of table @TABLE@" id="text_latex_data_caption"><li class="list-group-item">
<label for="text_latex_data_continued_caption" class="form-label">Table caption (continued):</label><input class="form-control" type="text" name="latex_data_continued_caption" value="Content of table @TABLE@ (continued)" id="text_latex_data_continued_caption"><li class="list-group-item">
<label for="text_latex_data_label" class="form-label">Label key:</label><input class="form-control" type="text" name="latex_data_label" value="tab:@TABLE@-data" id="text_latex_data_label"><li class="list-group-item">
<label for="text_latex_null" class="form-label">Replace NULL with:</label><input class="form-control" type="text" name="latex_null" value="\textit{NULL}" id="text_latex_null"></ul></div></li>
<div id="latex_data"><h5 class="card-title mt-4 mb-2">Data dump options</h5><ul class="list-group">
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="latex_columns" value="y" id="checkbox_latex_columns" checked><label class="form-check-label" for="checkbox_latex_columns">Put columns names in the first row:</label></div>
<li class="list-group-item"><label for="text_latex_data_caption" class="form-label">Table caption:</label><input class="form-control" type="text" name="latex_data_caption" value="Content of table @TABLE@" id="text_latex_data_caption"><a href="index.php?route=/url&url=https%3A%2F%2Fdocs.phpmyadmin.net%2Fen%2Flatest%2Ffaq.html%23faq6-27" target="documentation"><img src="themes/dot.gif" title="Documentation" alt="Documentation" class="icon ic_b_help"></a>
<li class="list-group-item"><label for="text_latex_data_continued_caption" class="form-label">Table caption (continued):</label><input class="form-control" type="text" name="latex_data_continued_caption" value="Content of table @TABLE@ (continued)" id="text_latex_data_continued_caption"><a href="index.php?route=/url&url=https%3A%2F%2Fdocs.phpmyadmin.net%2Fen%2Flatest%2Ffaq.html%23faq6-27" target="documentation"><img src="themes/dot.gif" title="Documentation" alt="Documentation" class="icon ic_b_help"></a>
<li class="list-group-item"><label for="text_latex_data_label" class="form-label">Label key:</label><input class="form-control" type="text" name="latex_data_label" value="tab:@TABLE@-data" id="text_latex_data_label"><a href="index.php?route=/url&url=https%3A%2F%2Fdocs.phpmyadmin.net%2Fen%2Flatest%2Ffaq.html%23faq6-27" target="documentation"><img src="themes/dot.gif" title="Documentation" alt="Documentation" class="icon ic_b_help"></a>
<li class="list-group-item"><label for="text_latex_null" class="form-label">Replace NULL with:</label><input class="form-control" type="text" name="latex_null" value="\textit{NULL}" id="text_latex_null">
</ul></div>
</div>
<div id="mediawiki_options" class="format_specific_options"><h3>MediaWiki Table</h3>
<div id="mediawiki_general_opts"><h5 class="card-title mt-4 mb-2">Dump table</h5><ul class="list-group">
<li class="list-group-item"><div class="form-check"><input type="radio" name="mediawiki_structure_or_data" class="form-check-input" value="structure" id="radio_mediawiki_structure_or_data_structure"><label class="form-check-label" for="radio_mediawiki_structure_or_data_structure">structure</label></div><div class="form-check"><input type="radio" name="mediawiki_structure_or_data" class="form-check-input" value="data" id="radio_mediawiki_structure_or_data_data" checked><label class="form-check-label" for="radio_mediawiki_structure_or_data_data">data</label></div><div class="form-check"><input type="radio" name="mediawiki_structure_or_data" class="form-check-input" value="structure_and_data" id="radio_mediawiki_structure_or_data_structure_and_data"><label class="form-check-label" for="radio_mediawiki_structure_or_data_structure_and_data">structure and data</label></div></li>
<li class="list-group-item"><div class="form-check"><input type="radio" name="mediawiki_structure_or_data" class="form-check-input" value="structure" id="radio_mediawiki_structure_or_data_structure"><label class="form-check-label" for="radio_mediawiki_structure_or_data_structure">structure</label></div><div class="form-check"><input type="radio" name="mediawiki_structure_or_data" class="form-check-input" value="data" id="radio_mediawiki_structure_or_data_data" checked><label class="form-check-label" for="radio_mediawiki_structure_or_data_data">data</label></div><div class="form-check"><input type="radio" name="mediawiki_structure_or_data" class="form-check-input" value="structure_and_data" id="radio_mediawiki_structure_or_data_structure_and_data"><label class="form-check-label" for="radio_mediawiki_structure_or_data_structure_and_data">structure and data</label></div>
<li class="list-group-item"><ul class="list-group" id="ul_structure_or_data">
</ul></li>
<li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="mediawiki_caption" value="y" id="checkbox_mediawiki_caption" checked><label class="form-check-label" for="checkbox_mediawiki_caption">Export table names</label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="mediawiki_headers" value="y" id="checkbox_mediawiki_headers" checked><label class="form-check-label" for="checkbox_mediawiki_headers">Export table headers</label></div></ul></div></li>
</ul>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="mediawiki_caption" value="y" id="checkbox_mediawiki_caption" checked><label class="form-check-label" for="checkbox_mediawiki_caption">Export table names</label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="mediawiki_headers" value="y" id="checkbox_mediawiki_headers" checked><label class="form-check-label" for="checkbox_mediawiki_headers">Export table headers</label></div>
</ul></div>
</div>
<div id="htmlword_options" class="format_specific_options"><h3>Microsoft Word 2000</h3>
<div id="htmlword_dump_what"><h5 class="card-title mt-4 mb-2">Dump table</h5><ul class="list-group"><li class="list-group-item"><div class="form-check"><input type="radio" name="htmlword_structure_or_data" class="form-check-input" value="structure" id="radio_htmlword_structure_or_data_structure"><label class="form-check-label" for="radio_htmlword_structure_or_data_structure">structure</label></div><div class="form-check"><input type="radio" name="htmlword_structure_or_data" class="form-check-input" value="data" id="radio_htmlword_structure_or_data_data"><label class="form-check-label" for="radio_htmlword_structure_or_data_data">data</label></div><div class="form-check"><input type="radio" name="htmlword_structure_or_data" class="form-check-input" value="structure_and_data" id="radio_htmlword_structure_or_data_structure_and_data" checked><label class="form-check-label" for="radio_htmlword_structure_or_data_structure_and_data">structure and data</label></div></li></ul></div>
<div id="htmlword_dump_what"><h5 class="card-title mt-4 mb-2">Dump table</h5><ul class="list-group">
<li class="list-group-item"><div class="form-check"><input type="radio" name="htmlword_structure_or_data" class="form-check-input" value="structure" id="radio_htmlword_structure_or_data_structure"><label class="form-check-label" for="radio_htmlword_structure_or_data_structure">structure</label></div><div class="form-check"><input type="radio" name="htmlword_structure_or_data" class="form-check-input" value="data" id="radio_htmlword_structure_or_data_data"><label class="form-check-label" for="radio_htmlword_structure_or_data_data">data</label></div><div class="form-check"><input type="radio" name="htmlword_structure_or_data" class="form-check-input" value="structure_and_data" id="radio_htmlword_structure_or_data_structure_and_data" checked><label class="form-check-label" for="radio_htmlword_structure_or_data_structure_and_data">structure and data</label></div>
</ul></div>
<div id="htmlword_dump_what"><h5 class="card-title mt-4 mb-2">Data dump options</h5><ul class="list-group"><li class="list-group-item">
<label for="text_htmlword_null" class="form-label">Replace NULL with:</label><input class="form-control" type="text" name="htmlword_null" value="NULL" id="text_htmlword_null"><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="htmlword_columns" value="y" id="checkbox_htmlword_columns" ><label class="form-check-label" for="checkbox_htmlword_columns">Put columns names in the first row</label></div></ul></div></li>
<div id="htmlword_dump_what"><h5 class="card-title mt-4 mb-2">Data dump options</h5><ul class="list-group">
<li class="list-group-item"><label for="text_htmlword_null" class="form-label">Replace NULL with:</label><input class="form-control" type="text" name="htmlword_null" value="NULL" id="text_htmlword_null">
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="htmlword_columns" value="y" id="checkbox_htmlword_columns" ><label class="form-check-label" for="checkbox_htmlword_columns">Put columns names in the first row</label></div>
</ul></div>
</div>
<div id="ods_options" class="format_specific_options"><h3>OpenDocument Spreadsheet</h3>
<div id="ods_general_opts"><ul class="list-group"><li class="list-group-item">
<label for="text_ods_null" class="form-label">Replace NULL with:</label><input class="form-control" type="text" name="ods_null" value="NULL" id="text_ods_null"><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="ods_columns" value="y" id="checkbox_ods_columns" checked><label class="form-check-label" for="checkbox_ods_columns">Put columns names in the first row</label></div><li class="list-group-item"><input type="hidden" name="ods_structure_or_data" value="data"></li></ul></div>
<div id="ods_general_opts"><ul class="list-group">
<li class="list-group-item"><label for="text_ods_null" class="form-label">Replace NULL with:</label><input class="form-control" type="text" name="ods_null" value="NULL" id="text_ods_null">
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="ods_columns" value="y" id="checkbox_ods_columns" checked><label class="form-check-label" for="checkbox_ods_columns">Put columns names in the first row</label></div>
<li class="list-group-item"><input type="hidden" name="ods_structure_or_data" value="data">
</ul></div>
</div>
<div id="odt_options" class="format_specific_options"><h3>OpenDocument Text</h3>
<div id="odt_general_opts"><h5 class="card-title mt-4 mb-2">Dump table</h5><ul class="list-group"><li class="list-group-item"><div class="form-check"><input type="radio" name="odt_structure_or_data" class="form-check-input" value="structure" id="radio_odt_structure_or_data_structure"><label class="form-check-label" for="radio_odt_structure_or_data_structure">structure</label></div><div class="form-check"><input type="radio" name="odt_structure_or_data" class="form-check-input" value="data" id="radio_odt_structure_or_data_data"><label class="form-check-label" for="radio_odt_structure_or_data_data">data</label></div><div class="form-check"><input type="radio" name="odt_structure_or_data" class="form-check-input" value="structure_and_data" id="radio_odt_structure_or_data_structure_and_data" checked><label class="form-check-label" for="radio_odt_structure_or_data_structure_and_data">structure and data</label></div></li></ul></div>
<div id="odt_general_opts"><h5 class="card-title mt-4 mb-2">Dump table</h5><ul class="list-group">
<li class="list-group-item"><div class="form-check"><input type="radio" name="odt_structure_or_data" class="form-check-input" value="structure" id="radio_odt_structure_or_data_structure"><label class="form-check-label" for="radio_odt_structure_or_data_structure">structure</label></div><div class="form-check"><input type="radio" name="odt_structure_or_data" class="form-check-input" value="data" id="radio_odt_structure_or_data_data"><label class="form-check-label" for="radio_odt_structure_or_data_data">data</label></div><div class="form-check"><input type="radio" name="odt_structure_or_data" class="form-check-input" value="structure_and_data" id="radio_odt_structure_or_data_structure_and_data" checked><label class="form-check-label" for="radio_odt_structure_or_data_structure_and_data">structure and data</label></div>
</ul></div>
<div id="odt_structure"><h5 class="card-title mt-4 mb-2">Object creation options</h5><ul class="list-group"><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="odt_comments" value="y" id="checkbox_odt_comments" checked><label class="form-check-label" for="checkbox_odt_comments">Display comments</label></div></ul></div></li>
<div id="odt_structure"><h5 class="card-title mt-4 mb-2">Object creation options</h5><ul class="list-group">
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="odt_comments" value="y" id="checkbox_odt_comments" checked><label class="form-check-label" for="checkbox_odt_comments">Display comments</label></div>
</ul></div>
<div id="odt_data"><h5 class="card-title mt-4 mb-2">Data dump options</h5><ul class="list-group"><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="odt_columns" value="y" id="checkbox_odt_columns" checked><label class="form-check-label" for="checkbox_odt_columns">Put columns names in the first row</label></div><li class="list-group-item">
<label for="text_odt_null" class="form-label">Replace NULL with:</label><input class="form-control" type="text" name="odt_null" value="NULL" id="text_odt_null"></ul></div></li>
<div id="odt_data"><h5 class="card-title mt-4 mb-2">Data dump options</h5><ul class="list-group">
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="odt_columns" value="y" id="checkbox_odt_columns" checked><label class="form-check-label" for="checkbox_odt_columns">Put columns names in the first row</label></div>
<li class="list-group-item"><label for="text_odt_null" class="form-label">Replace NULL with:</label><input class="form-control" type="text" name="odt_null" value="NULL" id="text_odt_null">
</ul></div>
</div>
<div id="pdf_options" class="format_specific_options"><h3>PDF</h3>
<div id="pdf_general_opts"><ul class="list-group"><li class="list-group-item">
<label for="text_pdf_report_title" class="form-label">Report title:</label><input class="form-control" type="text" name="pdf_report_title" value="" id="text_pdf_report_title"></ul></div></li>
<div id="pdf_general_opts"><ul class="list-group">
<li class="list-group-item"><label for="text_pdf_report_title" class="form-label">Report title:</label><input class="form-control" type="text" name="pdf_report_title" value="" id="text_pdf_report_title">
</ul></div>
<div id="pdf_dump_what"><h5 class="card-title mt-4 mb-2">Dump table</h5><ul class="list-group"><li class="list-group-item"><div class="form-check"><input type="radio" name="pdf_structure_or_data" class="form-check-input" value="structure" id="radio_pdf_structure_or_data_structure"><label class="form-check-label" for="radio_pdf_structure_or_data_structure">structure</label></div><div class="form-check"><input type="radio" name="pdf_structure_or_data" class="form-check-input" value="data" id="radio_pdf_structure_or_data_data" checked><label class="form-check-label" for="radio_pdf_structure_or_data_data">data</label></div><div class="form-check"><input type="radio" name="pdf_structure_or_data" class="form-check-input" value="structure_and_data" id="radio_pdf_structure_or_data_structure_and_data"><label class="form-check-label" for="radio_pdf_structure_or_data_structure_and_data">structure and data</label></div></li></ul></div>
<div id="pdf_dump_what"><h5 class="card-title mt-4 mb-2">Dump table</h5><ul class="list-group">
<li class="list-group-item"><div class="form-check"><input type="radio" name="pdf_structure_or_data" class="form-check-input" value="structure" id="radio_pdf_structure_or_data_structure"><label class="form-check-label" for="radio_pdf_structure_or_data_structure">structure</label></div><div class="form-check"><input type="radio" name="pdf_structure_or_data" class="form-check-input" value="data" id="radio_pdf_structure_or_data_data" checked><label class="form-check-label" for="radio_pdf_structure_or_data_data">data</label></div><div class="form-check"><input type="radio" name="pdf_structure_or_data" class="form-check-input" value="structure_and_data" id="radio_pdf_structure_or_data_structure_and_data"><label class="form-check-label" for="radio_pdf_structure_or_data_structure_and_data">structure and data</label></div>
</ul></div>
</div>
<div id="phparray_options" class="format_specific_options"><h3>PHP array</h3>
<div id="phparray_general_opts"><ul class="list-group"><li class="list-group-item"><input type="hidden" name="phparray_structure_or_data" value="data"></li></ul></div>
<div id="phparray_general_opts"><ul class="list-group">
<li class="list-group-item"><input type="hidden" name="phparray_structure_or_data" value="data">
</ul></div>
<p class="card-text">This format has no options</p></div>
<div id="sql_options" class="format_specific_options"><h3>SQL</h3>
<div id="sql_general_opts"><ul class="list-group">
<li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_include_comments" value="y" id="checkbox_sql_include_comments" checked><label class="form-check-label" for="checkbox_sql_include_comments">Display comments <i>(includes info such as export timestamp, PHP version, and server version)</i></label></div></li>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_include_comments" value="y" id="checkbox_sql_include_comments" checked><label class="form-check-label" for="checkbox_sql_include_comments">Display comments <i>(includes info such as export timestamp, PHP version, and server version)</i></label></div>
<li class="list-group-item"><ul class="list-group" id="ul_include_comments">
<li class="list-group-item">
<label for="text_sql_header_comment" class="form-label">Additional custom header comment (\n splits lines):</label><input class="form-control" type="text" name="sql_header_comment" value="" id="text_sql_header_comment"><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_dates" value="y" id="checkbox_sql_dates" ><label class="form-check-label" for="checkbox_sql_dates">Include a timestamp of when databases were created, last updated, and last checked</label></div></ul></li></li>
<li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_use_transaction" value="y" id="checkbox_sql_use_transaction" checked><label class="form-check-label" for="checkbox_sql_use_transaction">Enclose export in a transaction</label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_disable_fk" value="y" id="checkbox_sql_disable_fk" ><label class="form-check-label" for="checkbox_sql_disable_fk">Disable foreign key checks</label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_views_as_tables" value="y" id="checkbox_sql_views_as_tables" ><label class="form-check-label" for="checkbox_sql_views_as_tables">Export views as tables</label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_metadata" value="y" id="checkbox_sql_metadata" ><label class="form-check-label" for="checkbox_sql_metadata">Export metadata</label></div><li class="list-group-item">
<label for="select_sql_compatibility" class="form-label">Database system or older MySQL server to maximize output compatibility with:</label><select class="form-select" name="sql_compatibility" id="select_sql_compatibility"><option value="NONE" selected>NONE</option><option value="ANSI">ANSI</option><option value="DB2">DB2</option><option value="MAXDB">MAXDB</option><option value="MYSQL323">MYSQL323</option><option value="MYSQL40">MYSQL40</option><option value="MSSQL">MSSQL</option><option value="ORACLE">ORACLE</option><option value="TRADITIONAL">TRADITIONAL</option></select>
<li class="list-group-item"><div class="form-check"><input type="radio" name="sql_structure_or_data" class="form-check-input" value="structure" id="radio_sql_structure_or_data_structure"><label class="form-check-label" for="radio_sql_structure_or_data_structure">structure</label></div><div class="form-check"><input type="radio" name="sql_structure_or_data" class="form-check-input" value="data" id="radio_sql_structure_or_data_data"><label class="form-check-label" for="radio_sql_structure_or_data_data">data</label></div><div class="form-check"><input type="radio" name="sql_structure_or_data" class="form-check-input" value="structure_and_data" id="radio_sql_structure_or_data_structure_and_data" checked><label class="form-check-label" for="radio_sql_structure_or_data_structure_and_data">structure and data</label></div></li>
<li class="list-group-item"><label for="text_sql_header_comment" class="form-label">Additional custom header comment (\n splits lines):</label><input class="form-control" type="text" name="sql_header_comment" value="" id="text_sql_header_comment">
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_dates" value="y" id="checkbox_sql_dates" ><label class="form-check-label" for="checkbox_sql_dates">Include a timestamp of when databases were created, last updated, and last checked</label></div>
</ul>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_use_transaction" value="y" id="checkbox_sql_use_transaction" checked><label class="form-check-label" for="checkbox_sql_use_transaction">Enclose export in a transaction</label></div><a href="index.php?route=/url&url=https%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.7%2Fen%2Fmysqldump.html%23option_mysqldump_single-transaction" target="mysql_doc"><img src="themes/dot.gif" title="Documentation" alt="Documentation" class="icon ic_b_help"></a>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_disable_fk" value="y" id="checkbox_sql_disable_fk" ><label class="form-check-label" for="checkbox_sql_disable_fk">Disable foreign key checks</label></div><a href="index.php?route=/url&url=https%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.7%2Fen%2Fserver-system-variables.html%23sysvar_foreign_key_checks" target="mysql_doc"><img src="themes/dot.gif" title="Documentation" alt="Documentation" class="icon ic_b_help"></a>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_views_as_tables" value="y" id="checkbox_sql_views_as_tables" ><label class="form-check-label" for="checkbox_sql_views_as_tables">Export views as tables</label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_metadata" value="y" id="checkbox_sql_metadata" ><label class="form-check-label" for="checkbox_sql_metadata">Export metadata</label></div>
<li class="list-group-item"><label for="select_sql_compatibility" class="form-label">Database system or older MySQL server to maximize output compatibility with:</label><select class="form-select" name="sql_compatibility" id="select_sql_compatibility"><option value="NONE" selected>NONE</option><option value="ANSI">ANSI</option><option value="DB2">DB2</option><option value="MAXDB">MAXDB</option><option value="MYSQL323">MYSQL323</option><option value="MYSQL40">MYSQL40</option><option value="MSSQL">MSSQL</option><option value="ORACLE">ORACLE</option><option value="TRADITIONAL">TRADITIONAL</option></select><a href="index.php?route=/url&url=https%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.7%2Fen%2Fsql-mode.html" target="mysql_doc"><img src="themes/dot.gif" title="Documentation" alt="Documentation" class="icon ic_b_help"></a>
<li class="list-group-item"><div class="form-check"><input type="radio" name="sql_structure_or_data" class="form-check-input" value="structure" id="radio_sql_structure_or_data_structure"><label class="form-check-label" for="radio_sql_structure_or_data_structure">structure</label></div><div class="form-check"><input type="radio" name="sql_structure_or_data" class="form-check-input" value="data" id="radio_sql_structure_or_data_data"><label class="form-check-label" for="radio_sql_structure_or_data_data">data</label></div><div class="form-check"><input type="radio" name="sql_structure_or_data" class="form-check-input" value="structure_and_data" id="radio_sql_structure_or_data_structure_and_data" checked><label class="form-check-label" for="radio_sql_structure_or_data_structure_and_data">structure and data</label></div>
<li class="list-group-item"><ul class="list-group" id="ul_structure_or_data">
</ul></li>
</ul>
</ul></div>
<div id="sql_structure"><h5 class="card-title mt-4 mb-2">Object creation options</h5><ul class="list-group">
<li class="list-group-item">
Add statements:</li>
<li class="list-group-item">Add statements:
<li class="list-group-item"><ul class="list-group" id="ul_add_statements">
<li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_drop_table" value="y" id="checkbox_sql_drop_table" ><label class="form-check-label" for="checkbox_sql_drop_table">Add <code>DROP TABLE</code><code> / TRIGGER</code> statement</label></div>
<li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_create_table" value="y" id="checkbox_sql_create_table" checked><label class="form-check-label" for="checkbox_sql_create_table">Add <code>CREATE TABLE</code> statement</label></div></li>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_drop_table" value="y" id="checkbox_sql_drop_table" ><label class="form-check-label" for="checkbox_sql_drop_table">Add <code>DROP TABLE</code><code> / TRIGGER</code> statement</label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_create_table" value="y" id="checkbox_sql_create_table" checked><label class="form-check-label" for="checkbox_sql_create_table">Add <code>CREATE TABLE</code> statement</label></div>
<li class="list-group-item"><ul class="list-group" id="ul_create_table">
<li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_if_not_exists" value="y" id="checkbox_sql_if_not_exists" ><label class="form-check-label" for="checkbox_sql_if_not_exists"><code>IF NOT EXISTS</code> (less efficient as indexes will be generated during table creation)</label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_auto_increment" value="y" id="checkbox_sql_auto_increment" checked><label class="form-check-label" for="checkbox_sql_auto_increment"><code>AUTO_INCREMENT</code> value</label></div></ul></li></li>
<li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_create_view" value="y" id="checkbox_sql_create_view" checked><label class="form-check-label" for="checkbox_sql_create_view">Add <code>CREATE VIEW</code> statement</label></div></li>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_if_not_exists" value="y" id="checkbox_sql_if_not_exists" ><label class="form-check-label" for="checkbox_sql_if_not_exists"><code>IF NOT EXISTS</code> (less efficient as indexes will be generated during table creation)</label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_auto_increment" value="y" id="checkbox_sql_auto_increment" checked><label class="form-check-label" for="checkbox_sql_auto_increment"><code>AUTO_INCREMENT</code> value</label></div>
</ul>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_create_view" value="y" id="checkbox_sql_create_view" checked><label class="form-check-label" for="checkbox_sql_create_view">Add <code>CREATE VIEW</code> statement</label></div>
<li class="list-group-item"><ul class="list-group" id="ul_create_view">
<li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_simple_view_export" value="y" id="checkbox_sql_simple_view_export" ><label class="form-check-label" for="checkbox_sql_simple_view_export">Use simple view export</label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_view_current_user" value="y" id="checkbox_sql_view_current_user" ><label class="form-check-label" for="checkbox_sql_view_current_user">Exclude definition of current user</label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_or_replace_view" value="y" id="checkbox_sql_or_replace_view" ><label class="form-check-label" for="checkbox_sql_or_replace_view"><code>OR REPLACE</code> view</label></div></ul></li></li>
<li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_procedure_function" value="y" id="checkbox_sql_procedure_function" checked><label class="form-check-label" for="checkbox_sql_procedure_function">Add <code>CREATE PROCEDURE / FUNCTION / EVENT</code> statement</label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_create_trigger" value="y" id="checkbox_sql_create_trigger" checked><label class="form-check-label" for="checkbox_sql_create_trigger">Add <code>CREATE TRIGGER</code> statement</label></div></ul></li></li>
<li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_backquotes" value="y" id="checkbox_sql_backquotes" checked><label class="form-check-label" for="checkbox_sql_backquotes">Enclose table and column names with backquotes <i>(Protects column and table names formed with special characters or keywords)</i></label></div></ul></div></li>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_simple_view_export" value="y" id="checkbox_sql_simple_view_export" ><label class="form-check-label" for="checkbox_sql_simple_view_export">Use simple view export</label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_view_current_user" value="y" id="checkbox_sql_view_current_user" ><label class="form-check-label" for="checkbox_sql_view_current_user">Exclude definition of current user</label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_or_replace_view" value="y" id="checkbox_sql_or_replace_view" ><label class="form-check-label" for="checkbox_sql_or_replace_view"><code>OR REPLACE</code> view</label></div>
</ul>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_procedure_function" value="y" id="checkbox_sql_procedure_function" checked><label class="form-check-label" for="checkbox_sql_procedure_function">Add <code>CREATE PROCEDURE / FUNCTION / EVENT</code> statement</label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_create_trigger" value="y" id="checkbox_sql_create_trigger" checked><label class="form-check-label" for="checkbox_sql_create_trigger">Add <code>CREATE TRIGGER</code> statement</label></div>
</ul>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_backquotes" value="y" id="checkbox_sql_backquotes" checked><label class="form-check-label" for="checkbox_sql_backquotes">Enclose table and column names with backquotes <i>(Protects column and table names formed with special characters or keywords)</i></label></div>
</ul></div>
<div id="sql_data"><h5 class="card-title mt-4 mb-2">Data creation options</h5><ul class="list-group"><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_truncate" value="y" id="checkbox_sql_truncate" ><label class="form-check-label" for="checkbox_sql_truncate">Truncate table before insert</label></div>
<div id="sql_data"><h5 class="card-title mt-4 mb-2">Data creation options</h5><ul class="list-group">
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_truncate" value="y" id="checkbox_sql_truncate" ><label class="form-check-label" for="checkbox_sql_truncate">Truncate table before insert</label></div>
<li class="list-group-item">
</li>
<li class="list-group-item"><ul class="list-group" id="ul_Instead of <code>INSERT</code> statements, use:">
<li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_delayed" value="y" id="checkbox_sql_delayed" ><label class="form-check-label" for="checkbox_sql_delayed"><code>INSERT DELAYED</code> statements</label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_ignore" value="y" id="checkbox_sql_ignore" ><label class="form-check-label" for="checkbox_sql_ignore"><code>INSERT IGNORE</code> statements</label></div></ul></li></li>
<li class="list-group-item">
<label for="select_sql_type" class="form-label">Function to use when dumping data:</label><select class="form-select" name="sql_type" id="select_sql_type"><option value="INSERT" selected>INSERT</option><option value="UPDATE">UPDATE</option><option value="REPLACE">REPLACE</option></select>
<li class="list-group-item">
Syntax to use when inserting data:</li>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_delayed" value="y" id="checkbox_sql_delayed" ><label class="form-check-label" for="checkbox_sql_delayed"><code>INSERT DELAYED</code> statements</label></div><a href="index.php?route=/url&url=https%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.7%2Fen%2Finsert-delayed.html" target="mysql_doc"><img src="themes/dot.gif" title="Documentation" alt="Documentation" class="icon ic_b_help"></a>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_ignore" value="y" id="checkbox_sql_ignore" ><label class="form-check-label" for="checkbox_sql_ignore"><code>INSERT IGNORE</code> statements</label></div><a href="index.php?route=/url&url=https%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.7%2Fen%2Finsert.html" target="mysql_doc"><img src="themes/dot.gif" title="Documentation" alt="Documentation" class="icon ic_b_help"></a>
</ul>
<li class="list-group-item"><label for="select_sql_type" class="form-label">Function to use when dumping data:</label><select class="form-select" name="sql_type" id="select_sql_type"><option value="INSERT" selected>INSERT</option><option value="UPDATE">UPDATE</option><option value="REPLACE">REPLACE</option></select>
<li class="list-group-item">Syntax to use when inserting data:
<li class="list-group-item"><ul class="list-group" id="ul_">
<li class="list-group-item"><div class="form-check"><input type="radio" name="sql_insert_syntax" class="form-check-input" value="complete" id="radio_sql_insert_syntax_complete"><label class="form-check-label" for="radio_sql_insert_syntax_complete">include column names in every <code>INSERT</code> statement <br> &nbsp; &nbsp; &nbsp; Example: <code>INSERT INTO tbl_name (col_A,col_B,col_C) VALUES (1,2,3)</code></label></div><div class="form-check"><input type="radio" name="sql_insert_syntax" class="form-check-input" value="extended" id="radio_sql_insert_syntax_extended"><label class="form-check-label" for="radio_sql_insert_syntax_extended">insert multiple rows in every <code>INSERT</code> statement<br> &nbsp; &nbsp; &nbsp; Example: <code>INSERT INTO tbl_name VALUES (1,2,3), (4,5,6), (7,8,9)</code></label></div><div class="form-check"><input type="radio" name="sql_insert_syntax" class="form-check-input" value="both" id="radio_sql_insert_syntax_both" checked><label class="form-check-label" for="radio_sql_insert_syntax_both">both of the above<br> &nbsp; &nbsp; &nbsp; Example: <code>INSERT INTO tbl_name (col_A,col_B,col_C) VALUES (1,2,3), (4,5,6), (7,8,9)</code></label></div><div class="form-check"><input type="radio" name="sql_insert_syntax" class="form-check-input" value="none" id="radio_sql_insert_syntax_none"><label class="form-check-label" for="radio_sql_insert_syntax_none">neither of the above<br> &nbsp; &nbsp; &nbsp; Example: <code>INSERT INTO tbl_name VALUES (1,2,3)</code></label></div></li></ul></li>
<li class="list-group-item">
<label for="number_sql_max_query_size" class="form-label">Maximal length of created query</label><input class="form-control" type="number" name="sql_max_query_size" value="50000" id="number_sql_max_query_size" min="0"><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_hex_for_binary" value="y" id="checkbox_sql_hex_for_binary" checked><label class="form-check-label" for="checkbox_sql_hex_for_binary">Dump binary columns in hexadecimal notation <i>(for example, "abc" becomes 0x616263)</i></label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="sql_utc_time" value="y" id="checkbox_sql_utc_time" checked><label class="form-check-label" for="checkbox_sql_utc_time">Dump TIMESTAMP columns in UTC <i>(enables TIMESTAMP columns to be dumped and reloaded between servers in different time zones)</i></label></div></ul></div></li>
<li class="list-group-item"><div class="form-check"><input type="radio" name="sql_insert_syntax" class="form-check-input" value="complete" id="radio_sql_insert_syntax_complete"><label class="form-check-label" for="radio_sql_insert_syntax_complete">include column names in every <code>INSERT</code> statement <br> &nbsp; &nbsp; &nbsp; Example: <code>INSERT INTO tbl_name (col_A,col_B,col_C) VALUES (1,2,3)</code></label></div><div class="form-check"><input type="radio" name="sql_insert_syntax" class="form-check-input" value="extended" id="radio_sql_insert_syntax_extended"><label class="form-check-label" for="radio_sql_insert_syntax_extended">insert multiple rows in every <code>INSERT</code> statement<br> &nbsp; &nbsp; &nbsp; Example: <code>INSERT INTO tbl_name VALUES (1,2,3), (4,5,6), (7,8,9)</code></label></div><div class="form-check"><input type="radio" name="sql_insert_syntax" class="form-check-input" value="both" id="radio_sql_insert_syntax_both" checked><label class="form-check-label" for="radio_sql_insert_syntax_both">both of the above<br> &nbsp; &nbsp; &nbsp; Example: <code>INSERT INTO tbl_name (col_A,col_B,col_C) VALUES (1,2,3), (4,5,6), (7,8,9)</code></label></div><div class="form-check"><input type="radio" name="sql_insert_syntax" class="form-check-input" value="none" id="radio_sql_insert_syntax_none"><label class="form-check-label" for="radio_sql_insert_syntax_none">neither of the above<br> &nbsp; &nbsp; &nbsp; Example: <code>INSERT INTO tbl_name VALUES (1,2,3)</code></label></div>
</ul>
<li class="list-group-item"><label for="number_sql_max_query_size" class="form-label">Maximal length of created query</label><input class="form-control" type="number" name="sql_max_query_size" value="50000" id="number_sql_max_query_size" min="0">
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_hex_for_binary" value="y" id="checkbox_sql_hex_for_binary" checked><label class="form-check-label" for="checkbox_sql_hex_for_binary">Dump binary columns in hexadecimal notation <i>(for example, "abc" becomes 0x616263)</i></label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="sql_utc_time" value="y" id="checkbox_sql_utc_time" checked><label class="form-check-label" for="checkbox_sql_utc_time">Dump TIMESTAMP columns in UTC <i>(enables TIMESTAMP columns to be dumped and reloaded between servers in different time zones)</i></label></div>
</ul></div>
</div>
<div id="texytext_options" class="format_specific_options"><h3>Texy! text</h3>
<div id="texytext_general_opts"><h5 class="card-title mt-4 mb-2">Dump table</h5><ul class="list-group"><li class="list-group-item"><div class="form-check"><input type="radio" name="texytext_structure_or_data" class="form-check-input" value="structure" id="radio_texytext_structure_or_data_structure"><label class="form-check-label" for="radio_texytext_structure_or_data_structure">structure</label></div><div class="form-check"><input type="radio" name="texytext_structure_or_data" class="form-check-input" value="data" id="radio_texytext_structure_or_data_data"><label class="form-check-label" for="radio_texytext_structure_or_data_data">data</label></div><div class="form-check"><input type="radio" name="texytext_structure_or_data" class="form-check-input" value="structure_and_data" id="radio_texytext_structure_or_data_structure_and_data" checked><label class="form-check-label" for="radio_texytext_structure_or_data_structure_and_data">structure and data</label></div></li></ul></div>
<div id="texytext_general_opts"><h5 class="card-title mt-4 mb-2">Dump table</h5><ul class="list-group">
<li class="list-group-item"><div class="form-check"><input type="radio" name="texytext_structure_or_data" class="form-check-input" value="structure" id="radio_texytext_structure_or_data_structure"><label class="form-check-label" for="radio_texytext_structure_or_data_structure">structure</label></div><div class="form-check"><input type="radio" name="texytext_structure_or_data" class="form-check-input" value="data" id="radio_texytext_structure_or_data_data"><label class="form-check-label" for="radio_texytext_structure_or_data_data">data</label></div><div class="form-check"><input type="radio" name="texytext_structure_or_data" class="form-check-input" value="structure_and_data" id="radio_texytext_structure_or_data_structure_and_data" checked><label class="form-check-label" for="radio_texytext_structure_or_data_structure_and_data">structure and data</label></div>
</ul></div>
<div id="texytext_data"><h5 class="card-title mt-4 mb-2">Data dump options</h5><ul class="list-group"><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="texytext_columns" value="y" id="checkbox_texytext_columns" ><label class="form-check-label" for="checkbox_texytext_columns">Put columns names in the first row</label></div><li class="list-group-item">
<label for="text_texytext_null" class="form-label">Replace NULL with:</label><input class="form-control" type="text" name="texytext_null" value="NULL" id="text_texytext_null"></ul></div></li>
<div id="texytext_data"><h5 class="card-title mt-4 mb-2">Data dump options</h5><ul class="list-group">
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="texytext_columns" value="y" id="checkbox_texytext_columns" ><label class="form-check-label" for="checkbox_texytext_columns">Put columns names in the first row</label></div>
<li class="list-group-item"><label for="text_texytext_null" class="form-label">Replace NULL with:</label><input class="form-control" type="text" name="texytext_null" value="NULL" id="text_texytext_null">
</ul></div>
</div>
<div id="toon_options" class="format_specific_options"><h3>TOON</h3>
<div id="toon_general_opts"><ul class="list-group"><li class="list-group-item">
<label for="text_toon_separator" class="form-label">Columns separated with:</label><input class="form-control" type="text" name="toon_separator" value="," id="text_toon_separator"><li class="list-group-item">
<label for="text_toon_indent" class="form-label">Indentation:</label><input class="form-control" type="text" name="toon_indent" value="2" id="text_toon_indent"><li class="list-group-item"><input type="hidden" name="toon_structure_or_data" value="structure_and_data"></li></ul></div>
<div id="toon_general_opts"><ul class="list-group">
<li class="list-group-item"><label for="text_toon_separator" class="form-label">Columns separated with:</label><input class="form-control" type="text" name="toon_separator" value="," id="text_toon_separator">
<li class="list-group-item"><label for="text_toon_indent" class="form-label">Indentation:</label><input class="form-control" type="text" name="toon_indent" value="2" id="text_toon_indent">
<li class="list-group-item"><input type="hidden" name="toon_structure_or_data" value="structure_and_data">
</ul></div>
</div>
<div id="yaml_options" class="format_specific_options"><h3>YAML</h3>
<div id="yaml_general_opts"><ul class="list-group"><li class="list-group-item"><input type="hidden" name="yaml_structure_or_data" value="data"></li></ul></div>
<div id="yaml_general_opts"><ul class="list-group">
<li class="list-group-item"><input type="hidden" name="yaml_structure_or_data" value="data">
</ul></div>
<p class="card-text">This format has no options</p></div>
@ -452,56 +433,47 @@ class PluginsTest extends AbstractTestCase
public function testGetOptionsForSchema(): void
{
ContainerBuilder::$container = $this->getContainerForGetOptions($this->createDatabaseInterface());
$options = Plugins::getOptions('Schema', Plugins::getSchema());
$options = Plugins::getOptions(PluginType::Schema, Plugins::getSchema());
// phpcs:disable Generic.Files.LineLength.TooLong
$expected = <<<'HTML'
<div id="dia_options" class="format_specific_options"><h3>Dia</h3>
<div id="dia_general_opts"><ul class="list-group"><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="dia_show_color" value="y" id="checkbox_dia_show_color" checked><label class="form-check-label" for="checkbox_dia_show_color">Show color</label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="dia_show_keys" value="y" id="checkbox_dia_show_keys" ><label class="form-check-label" for="checkbox_dia_show_keys">Only show keys</label></div><li class="list-group-item">
<label for="select_dia_orientation" class="form-label">Orientation</label><select class="form-select" name="dia_orientation" id="select_dia_orientation"><option value="L" selected>Landscape</option><option value="P">Portrait</option></select><li class="list-group-item">
<label for="select_dia_paper" class="form-label">Paper size</label><select class="form-select" name="dia_paper" id="select_dia_paper"><option value="A3">A3</option><option value="A4" selected>A4</option><option value="A5">A5</option><option value="letter">letter</option><option value="legal">legal</option></select></ul></div></li>
<div id="dia_general_opts"><ul class="list-group">
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="dia_show_color" value="y" id="checkbox_dia_show_color" checked><label class="form-check-label" for="checkbox_dia_show_color">Show color</label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="dia_show_keys" value="y" id="checkbox_dia_show_keys" ><label class="form-check-label" for="checkbox_dia_show_keys">Only show keys</label></div>
<li class="list-group-item"><label for="select_dia_orientation" class="form-label">Orientation</label><select class="form-select" name="dia_orientation" id="select_dia_orientation"><option value="L" selected>Landscape</option><option value="P">Portrait</option></select>
<li class="list-group-item"><label for="select_dia_paper" class="form-label">Paper size</label><select class="form-select" name="dia_paper" id="select_dia_paper"><option value="A3">A3</option><option value="A4" selected>A4</option><option value="A5">A5</option><option value="letter">letter</option><option value="legal">legal</option></select>
</ul></div>
</div>
<div id="eps_options" class="format_specific_options"><h3>EPS</h3>
<div id="eps_general_opts"><ul class="list-group"><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="eps_show_color" value="y" id="checkbox_eps_show_color" checked><label class="form-check-label" for="checkbox_eps_show_color">Show color</label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="eps_show_keys" value="y" id="checkbox_eps_show_keys" ><label class="form-check-label" for="checkbox_eps_show_keys">Only show keys</label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="eps_all_tables_same_width" value="y" id="checkbox_eps_all_tables_same_width" ><label class="form-check-label" for="checkbox_eps_all_tables_same_width">Same width for all tables</label></div><li class="list-group-item">
<label for="select_eps_orientation" class="form-label">Orientation</label><select class="form-select" name="eps_orientation" id="select_eps_orientation"><option value="L" selected>Landscape</option><option value="P">Portrait</option></select></ul></div></li>
<div id="eps_general_opts"><ul class="list-group">
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="eps_show_color" value="y" id="checkbox_eps_show_color" checked><label class="form-check-label" for="checkbox_eps_show_color">Show color</label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="eps_show_keys" value="y" id="checkbox_eps_show_keys" ><label class="form-check-label" for="checkbox_eps_show_keys">Only show keys</label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="eps_all_tables_same_width" value="y" id="checkbox_eps_all_tables_same_width" ><label class="form-check-label" for="checkbox_eps_all_tables_same_width">Same width for all tables</label></div>
<li class="list-group-item"><label for="select_eps_orientation" class="form-label">Orientation</label><select class="form-select" name="eps_orientation" id="select_eps_orientation"><option value="L" selected>Landscape</option><option value="P">Portrait</option></select>
</ul></div>
</div>
<div id="pdf_options" class="format_specific_options"><h3>PDF</h3>
<div id="pdf_general_opts"><ul class="list-group"><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="pdf_show_color" value="y" id="checkbox_pdf_show_color" checked><label class="form-check-label" for="checkbox_pdf_show_color">Show color</label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="pdf_show_keys" value="y" id="checkbox_pdf_show_keys" ><label class="form-check-label" for="checkbox_pdf_show_keys">Only show keys</label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="pdf_all_tables_same_width" value="y" id="checkbox_pdf_all_tables_same_width" ><label class="form-check-label" for="checkbox_pdf_all_tables_same_width">Same width for all tables</label></div><li class="list-group-item">
<label for="select_pdf_orientation" class="form-label">Orientation</label><select class="form-select" name="pdf_orientation" id="select_pdf_orientation"><option value="L" selected>Landscape</option><option value="P">Portrait</option></select><li class="list-group-item">
<label for="select_pdf_paper" class="form-label">Paper size</label><select class="form-select" name="pdf_paper" id="select_pdf_paper"><option value="A3">A3</option><option value="A4" selected>A4</option><option value="A5">A5</option><option value="letter">letter</option><option value="legal">legal</option></select><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="pdf_show_grid" value="y" id="checkbox_pdf_show_grid" ><label class="form-check-label" for="checkbox_pdf_show_grid">Show grid</label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="pdf_with_doc" value="y" id="checkbox_pdf_with_doc" checked><label class="form-check-label" for="checkbox_pdf_with_doc">Data dictionary</label></div><li class="list-group-item">
<label for="select_pdf_table_order" class="form-label">Order of the tables</label><select class="form-select" name="pdf_table_order" id="select_pdf_table_order"><option value="" selected>None</option><option value="name_asc">Name (Ascending)</option><option value="name_desc">Name (Descending)</option></select></ul></div></li>
<div id="pdf_general_opts"><ul class="list-group">
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="pdf_show_color" value="y" id="checkbox_pdf_show_color" checked><label class="form-check-label" for="checkbox_pdf_show_color">Show color</label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="pdf_show_keys" value="y" id="checkbox_pdf_show_keys" ><label class="form-check-label" for="checkbox_pdf_show_keys">Only show keys</label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="pdf_all_tables_same_width" value="y" id="checkbox_pdf_all_tables_same_width" ><label class="form-check-label" for="checkbox_pdf_all_tables_same_width">Same width for all tables</label></div>
<li class="list-group-item"><label for="select_pdf_orientation" class="form-label">Orientation</label><select class="form-select" name="pdf_orientation" id="select_pdf_orientation"><option value="L" selected>Landscape</option><option value="P">Portrait</option></select>
<li class="list-group-item"><label for="select_pdf_paper" class="form-label">Paper size</label><select class="form-select" name="pdf_paper" id="select_pdf_paper"><option value="A3">A3</option><option value="A4" selected>A4</option><option value="A5">A5</option><option value="letter">letter</option><option value="legal">legal</option></select>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="pdf_show_grid" value="y" id="checkbox_pdf_show_grid" ><label class="form-check-label" for="checkbox_pdf_show_grid">Show grid</label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="pdf_with_doc" value="y" id="checkbox_pdf_with_doc" checked><label class="form-check-label" for="checkbox_pdf_with_doc">Data dictionary</label></div>
<li class="list-group-item"><label for="select_pdf_table_order" class="form-label">Order of the tables</label><select class="form-select" name="pdf_table_order" id="select_pdf_table_order"><option value="" selected>None</option><option value="name_asc">Name (Ascending)</option><option value="name_desc">Name (Descending)</option></select>
</ul></div>
</div>
<div id="svg_options" class="format_specific_options"><h3>SVG</h3>
<div id="svg_general_opts"><ul class="list-group"><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="svg_show_color" value="y" id="checkbox_svg_show_color" checked><label class="form-check-label" for="checkbox_svg_show_color">Show color</label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="svg_show_keys" value="y" id="checkbox_svg_show_keys" ><label class="form-check-label" for="checkbox_svg_show_keys">Only show keys</label></div><li class="list-group-item">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="svg_all_tables_same_width" value="y" id="checkbox_svg_all_tables_same_width" ><label class="form-check-label" for="checkbox_svg_all_tables_same_width">Same width for all tables</label></div></ul></div></li>
<div id="svg_general_opts"><ul class="list-group">
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="svg_show_color" value="y" id="checkbox_svg_show_color" checked><label class="form-check-label" for="checkbox_svg_show_color">Show color</label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="svg_show_keys" value="y" id="checkbox_svg_show_keys" ><label class="form-check-label" for="checkbox_svg_show_keys">Only show keys</label></div>
<li class="list-group-item"><div class="form-check form-switch"><input class="form-check-input" type="checkbox" role="switch" name="svg_all_tables_same_width" value="y" id="checkbox_svg_all_tables_same_width" ><label class="form-check-label" for="checkbox_svg_all_tables_same_width">Same width for all tables</label></div>
</ul></div>
</div>

View File

@ -61,6 +61,6 @@ class OptionsPropertyGroupTest extends AbstractTestCase
$this->stub->addProperty($propertyItem);
$propertyItem2 = new BoolPropertyItem();
$this->stub->addProperty($propertyItem2);
self::assertSame(2, $this->stub->count());
self::assertCount(2, $this->stub);
}
}

View File

@ -21,7 +21,7 @@ class OptionsPropertyOneItemTest extends AbstractTestCase
{
parent::setUp();
$this->stub = $this->getMockBuilder(OptionsPropertyOneItem::class)->onlyMethods([])->getMock();
$this->stub = $this->getMockBuilder(OptionsPropertyOneItem::class)->onlyMethods(['getHtml'])->getMock();
}
/**
@ -31,10 +31,10 @@ class OptionsPropertyOneItemTest extends AbstractTestCase
*/
public function testGetSetValues(): void
{
$this->stub->setValues([1, 2]);
$this->stub->setValues(['1', '2']);
self::assertSame(
[1, 2],
['1', '2'],
$this->stub->getValues(),
);
}