mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] Support php versions in ynh_add_fpm_config
This commit is contained in:
parent
a974d08897
commit
ea8605db5c
1 changed files with 14 additions and 3 deletions
|
@ -240,11 +240,21 @@ ynh_remove_nginx_config () {
|
|||
|
||||
# Create a dedicated php-fpm config
|
||||
#
|
||||
# usage: ynh_add_fpm_config
|
||||
# usage: ynh_add_fpm_config [--phpversion=7.X]
|
||||
# | arg: -v, --phpversion - Version of php to use.
|
||||
ynh_add_fpm_config () {
|
||||
# Declare an array to define the options of this helper.
|
||||
local legacy_args=v
|
||||
declare -Ar args_array=( [v]=phpversion= )
|
||||
local phpversion
|
||||
# Manage arguments with getopts
|
||||
ynh_handle_getopts_args "$@"
|
||||
|
||||
# Configure PHP-FPM 7.0 by default
|
||||
local fpm_config_dir="/etc/php/7.0/fpm"
|
||||
local fpm_service="php7.0-fpm"
|
||||
phpversion="${phpversion:-7.0}"
|
||||
|
||||
local fpm_config_dir="/etc/php/$phpversion/fpm"
|
||||
local fpm_service="php${phpversion}-fpm"
|
||||
# Configure PHP-FPM 5 on Debian Jessie
|
||||
if [ "$(ynh_get_debian_release)" == "jessie" ]; then
|
||||
fpm_config_dir="/etc/php5/fpm"
|
||||
|
@ -258,6 +268,7 @@ ynh_add_fpm_config () {
|
|||
ynh_replace_string --match_string="__NAMETOCHANGE__" --replace_string="$app" --target_file="$finalphpconf"
|
||||
ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$finalphpconf"
|
||||
ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="$finalphpconf"
|
||||
ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="$finalphpconf"
|
||||
sudo chown root: "$finalphpconf"
|
||||
ynh_store_file_checksum --file="$finalphpconf"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue