1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 07:36:44 +02:00

Add "Compile Adminer with Plugin(s) and Design" page

François Capon
2020-11-11 14:38:22 +01:00
parent 652c34c56c
commit 44130167a6

@@ -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
```