This plugin enhances Adminer by adding a "Markdown" export format, allowing you
to dump database structure and data into Markdown-formatted text files (.md).
- Download and install Adminer tool.
- Download and install plugin.php
- Download and install dump-markdown.php
- create an index.php like the following:
<?php
function adminer_object() {
// required to run any plugin
include_once "./plugins/plugin.php";
// autoloader
foreach (glob("plugins/*.php") as $filename) {
include_once "./$filename";
}
$plugins = array(
new AdminerDumpMarkdown([
'rowSampleLimit' => 100,
'nullValue' => 'N/D',
'tablePipes' => false,
'tableAlign' => false,
'specialChars' => '\\*_[](){}+-#\!|', // Dot removed to keep decimals clean
'columnAlign' => ['id' => 'center'], // Ignored if tableAlign is false
'typeAlign' => [
'number' => 'right',
'bool' => 'center',
'default' => 'left'
]
]),
);
/* It is possible to combine customization and plugins:
class AdminerCustomization extends AdminerPlugin {
}
return new AdminerCustomization($plugins);
*/
return new AdminerPlugin($plugins);
}
// include original Adminer or Adminer Editor
include "./adminer-5.4.2-en.php";
?>File structure has to be like the following one:
- plugins
- plugin.php
- dump-markdown.php
- ...
- adminer.php
- index.php
The adminer-plugin-dump-markdown plugin can be configured using optional parameters passed
to the AdminerDumpMarkdown class constructor in your index.php file:
new AdminerDumpMarkdown([
// Configuration options here
]);The following configuration options are available:
Specifies the maximum number of rows to sample from each table when determining column widths for Markdown table formatting.
Defines the string to be used in the Markdown output to represent NULL database values.
Defines the set of special Markdown characters that will be escaped with a backslash (\) in the output.
Allows you to customize the characters used for Markdown table formatting:
'space': padding within table cells (default: space ).'table': table column separators (default: vertical bar |).'header': table header separator line (default: hyphen -).
disableUTF8: False(Default - Recommended): the plugin handles UTF-8 encoded data correctly, if the mbstring PHP extension is availabledisableUTF8: TrueWhen set to true, the plugin performs a lossy conversion of UTF-8 text data to ISO-8859-1 encoding
When true, wraps tables with leading and trailing pipes (|).
When true, includes alignment markers (:---) in the separator row. When false all columns are aligned to left.
typeAlign(array): Defines default alignment based on data types. number: defaults to right. bool: defaults to center. default: defaults to left (for text, varchars, dates, etc.).columnAlign(array): Manual override for specific columns. Example:'column_name' => 'center'
If the PHP mbstring extension is not enabled on your server, the plugin will automatically fall back to byte-based string operations for core functionality. It is recommended to enable the mbstring extension in your PHP configuration for better UTF-8 support.