From 44130167a6cd774a0a65c43119203709e1008b1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Capon?= <46624375+FrancoisCapon@users.noreply.github.com> Date: Wed, 11 Nov 2020 14:38:22 +0100 Subject: [PATCH] Add "Compile Adminer with Plugin(s) and Design" page --- Compile-Adminer-with-Plugin(s)-and-Design.md | 45 ++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Compile-Adminer-with-Plugin(s)-and-Design.md diff --git a/Compile-Adminer-with-Plugin(s)-and-Design.md b/Compile-Adminer-with-Plugin(s)-and-Design.md new file mode 100644 index 0000000..74dc2df --- /dev/null +++ b/Compile-Adminer-with-Plugin(s)-and-Design.md @@ -0,0 +1,45 @@ +# Compile Adminer with Plugin(s) and Design + +## `compile.php` +It is possible to compile a specific version of Adminer with only one translation and one database driver with the script `compile.php` +``` +Usage: php compile.php [editor] [driver] [lang] +Purpose: Compile adminer[-driver][-lang].php or editor[-driver][-lang].php. +``` +So by adding files and/or pieces of code to the Adminer sources before the compilation, it's possible to **compiled a custom version of Adminer**. + +## `compile.sh` + +### Add plugin(s) +The [`compile.sh`](https://github.com/FrancoisCapon/LoginToASqlite3DatabaseWithoutCredentialsWithAdminer/blob/master/compile.sh) from the [LoginToASqlite3DatabaseWithoutCredentialsWithAdminer](https://github.com/FrancoisCapon/LoginToASqlite3DatabaseWithoutCredentialsWithAdminer) repository is written to embedded this plugin but it can be easily modified to embedded any other plugin(s) in a dedicated version of Adminer: +```bash +echo -e "\n$step. Load plugin's sources:\n" +((step+=1)) +wget -P adminer/plugins/ https://raw.githubusercontent.com/.../master/fc-sqlite-connection-without-credentials.php +echo -e "\n$step. Adding the plugin to the sources\n" +((step+=1)) +cat << "EOPHP" >> adminer/adminer/include/bootstrap.inc.php +include "../plugins/plugin.php"; +include "../plugins/fc-sqlite-connection-without-credentials.php"; +function adminer_object() { + $plugins = array(new FCSqliteConnectionWithoutCredentials()); + return new AdminerPlugin($plugins); + } +EOPHP +``` + +### Add Adminer design +The script can also embedded design: +```bash +design=$2 +echo -e "\n$step. Set the design: $design\n" +((step+=1)) + cp $CSS_FILE $CSS_FILE.backup + cat $CSS_FILE.backup $DESIGNS_DIR/$design/adminer.css > $CSS_FILE +fi +``` + + + + + \ No newline at end of file