@@ -46,9 +46,13 @@ This script is used to *compile* a SQLite3 "dedicated" Adminer file:
4646* respect the philosophy of Adminer
4747> Adminer consist of a single file ready to deploy to the target server.
4848
49- :memo : You can contribute by filling the warning translations file.
49+ :memo : You can contribute by filling the warning translations file (` warning-translations.csv ` )
50+
51+ ### examples of usage
5052
5153``` bash
54+ > ./compile.sh
55+ usage: ./compile.sh languagecode [design]
5256> ./compile.sh en
53571. Load adminer' s sources:
5458
@@ -121,85 +125,7 @@ adminer-4.7.7-sqlite-fr.php created (193736 B).
121125
122126```
123127
124- ``` bash
125- if [ $# -lt 1 ]
126- then
127- echo ' usage: ./compile.sh languagecode [design]'
128- exit 1
129- fi
130-
131- LANGUAGES_DIR=" adminer/adminer/lang"
132- TRANSLATIONS_FILE=" warning-translations.csv"
133- CSS_FILE=" adminer/adminer/static/default.css"
134- DESIGNS_DIR=" adminer/designs"
135- COMPILE_CMD=" php adminer/compile.php sqlite "
136-
137- step=1
138- if [ ! -d " adminer" ]
139- then
140- echo -e " \n$step . Load adminer's sources:\n"
141- (( step+= 1 ))
142-
143- git clone --recurse-submodules https://github.com/vrana/adminer.git
144- echo -e " \n$step . Load plugin's sources:\n"
145- (( step+= 1 ))
146- wget -P adminer/plugins/ https://raw.githubusercontent.com/FrancoisCapon/LoginToASqlite3DatabaseWithoutCredentialsWithAdminer/master/fc-sqlite-connection-without-credentials.php
147- echo -e " \n$step . Adding the plugin to the sources\n"
148- (( step+= 1 ))
149- cat << "EOPHP " >> adminer/adminer/include/bootstrap.inc.php
150- include "../plugins/plugin.php";
151- include "../plugins/fc-sqlite-connection-without-credentials.php";
152- function adminer_object() {
153- $plugins = array(new FCSqliteConnectionWithoutCredentials());
154- return new AdminerPlugin($plugins);
155- }
156- EOPHP
157- fi
158-
159- echo -e " \n$step . Search warning translation\n"
160- (( step+= 1 ))
161-
162- language=$1
163- translation=$( grep ^$language , $TRANSLATIONS_FILE | cut -d' ,' -f2 | tr -d ' \n' )
164- if [ " $translation " != " " ]
165- then
166- echo $translation
167- cp $LANGUAGES_DIR /$language .inc.php $LANGUAGES_DIR /$language .inc.php.backup
168- sed -i ' s/);//' $LANGUAGES_DIR /$language .inc.php
169- cat << EOPHP >> $LANGUAGES_DIR /$language .inc.php
170- 'Warning: don\'t use it in a production environment!' => '$translation ',
171- );
172- EOPHP
173- fi
174-
175- if [ $# -eq 2 ]
176- then
177- design=$2
178- echo -e " \n$step . Set the design: $design \n"
179- (( step+= 1 ))
180- cp $CSS_FILE $CSS_FILE .backup
181- cat $CSS_FILE .backup $DESIGNS_DIR /$design /adminer.css > $CSS_FILE
182- fi
183-
184- echo -e " \n$step . Compile in language: $language \n"
185- (( step+= 1 ))
186-
187- $COMPILE_CMD $language 2> /dev/null
188-
189- echo -e " \n$step . Clean the sources\n"
190- (( step+= 1 ))
191- if [ " $translation " != " " ]
192- then
193- cp $LANGUAGES_DIR /$language .inc.php.backup $LANGUAGES_DIR /$language .inc.php
194- fi
195-
196- if [ $# -eq 2 ]
197- then
198- cp $CSS_FILE .backup $CSS_FILE
199- fi
200-
201- echo -e " \n$step . Voilà!\n"
202- ```
128+
203129
204130### :robot : Use the [ latest prebuilded release] ( https://github.com/FrancoisCapon/LoginToASqlite3DatabaseWithoutCredentialsWithAdminer/releases/latest )
205131
0 commit comments