1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/my_webapp_ynh.git synced 2024-09-03 19:46:26 +02:00

Add php-mysql if the database is installed

This commit is contained in:
Éric Gaspar 2022-08-28 13:26:45 +02:00
parent 6e6ce7609c
commit 22f9c65f01
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 8 additions and 6 deletions

View file

@ -5,7 +5,7 @@
with_sftp=1
password="myreallystrengthpassword"
is_public=1
phpversion="7.3"
phpversion="7.4"
with_mysql=1
; Checks
pkg_linter=1
@ -27,7 +27,7 @@
with_sftp=0
password=""
is_public=1
phpversion="7.3"
phpversion="7.4"
with_mysql=1
; Checks
setup_sub_dir=1
@ -40,7 +40,7 @@
with_sftp=1
password="myreallystrengthpassword"
is_public=1
phpversion="7.3"
phpversion="7.4"
with_mysql=0
; Checks
setup_sub_dir=1

View file

@ -18,12 +18,12 @@
"email": "maniackc_dev@crudelis.fr"
}],
"requirements": {
"yunohost": ">= 4.3.3"
"yunohost": ">= 11.0.9"
},
"multi_instance": true,
"services": [
"nginx",
"php7.3-fpm",
"php7.4-fpm",
"mysql"
],
"arguments": {
@ -65,7 +65,7 @@
"fr": "Choisissez une version PHP que vous souhaitez utiliser pour votre application"
},
"choices" : ["none", "7.3", "7.4", "8.0"],
"default" : "7.3"
"default" : "7.4"
},
{
"name": "with_mysql",

View file

@ -78,6 +78,8 @@ if [ $with_mysql -eq 1 ]
then
ynh_script_progression --message="Creating a MySQL database..." --weight=2
ynh_install_app_dependencies "php${phpversion}-mysql"
db_name=$(ynh_sanitize_dbid --db_name=$app)
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name