-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Compile Adminer with Plugin(s) and Design
Jakub Vrána edited this page Aug 30, 2021
·
6 revisions
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 compile a custom version of Adminer.
The compile.sh
from the LoginToASqlite3DatabaseWithoutCredentialsWithAdminer repository is written to embed this plugin but it can be easily modified to embedded any other plugin(s) in a dedicated version of Adminer:
echo -e "\n$step. Load plugin's sources:\n"
((step+=1))
wget -P adminer/plugins/ https://raw.githubusercontent.com/.../master/my-plugin.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"; // needed to add plugin(s) to Adminer
include "../plugins/my-plugin.php";
function adminer_object() {
$plugins = array(new MyPluginClasse());
return new AdminerPlugin($plugins);
}
EOPHP
The script can also embed design:
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