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(
// specify enabled plugins here
new AdminerDumpMarkdown([
// optional parameters
'rowSampleLimit' => 50,
'nullValue' => '(null)',
'disableUTF8' => False,
'specialChars' => '\\*_[](){}+-#.!|',
'markdown_chr' => ['space' => ' ', 'table' => '|', 'header' => '-']
]),
);
/* 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-4.3.1-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: True
When set to true, the plugin performs a lossy conversion of UTF-8 text data to ISO-8859-1 encoding
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.