1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wordpress_ynh.git synced 2024-09-03 20:36:10 +02:00

Add all settings for config panel

This commit is contained in:
tituspijean 2022-09-17 15:45:02 +02:00
parent acae00b583
commit 422cb3cc84
No known key found for this signature in database
GPG key ID: EF3B0D7CC0A94720
2 changed files with 18 additions and 3 deletions

View file

@ -108,15 +108,23 @@ ynh_add_nginx_config
#=================================================
ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
fpm_footprint="medium"
fpm_free_footprint=0
# If the app is private, set the usage to low, otherwise to high.
if [ $is_public -eq 0 ]
then
usage=low
fpm_usage="low"
else
usage=high
fpm_usage="high"
fi
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --usage=$usage --footprint=medium
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================

View file

@ -29,6 +29,7 @@ overwrite_phpfpm=$(ynh_app_setting_get --app=$app --key=overwrite_phpfpm)
admin_mail_html=$(ynh_app_setting_get --app=$app --key=admin_mail_html)
fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
fpm_free_footprint=$(ynh_app_setting_get --app=$app --key=fpm_free_footprint)
fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
@ -131,6 +132,12 @@ if [ -z "$fpm_footprint" ]; then
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
fi
# If fpm_free_footprint doesn't exist, create it
if [ -z "$fpm_free_footprint" ]; then
fpm_free_footprint=0
ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint
fi
# If fpm_usage doesn't exist, create it
if [ -z "$fpm_usage" ]; then
# If the app is private, set the usage to low, otherwise to high.