mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Use YNH_DEFAULT_PHP_VERSION instead of 7.0
This commit is contained in:
parent
d649fad13e
commit
017b0e929c
1 changed files with 8 additions and 8 deletions
|
@ -195,9 +195,9 @@ ynh_install_php () {
|
||||||
# Store phpversion into the config of this app
|
# Store phpversion into the config of this app
|
||||||
ynh_app_setting_set $app phpversion $phpversion
|
ynh_app_setting_set $app phpversion $phpversion
|
||||||
|
|
||||||
if [ "$phpversion" == "7.0" ]
|
if [ "$phpversion" == "$YNH_DEFAULT_PHP_VERSION" ]
|
||||||
then
|
then
|
||||||
ynh_die "Do not use ynh_install_php to install php7.0"
|
ynh_die "Do not use ynh_install_php to install php$YNH_DEFAULT_PHP_VERSION"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Store the ID of this app and the version of php requested for it
|
# Store the ID of this app and the version of php requested for it
|
||||||
|
@ -211,12 +211,12 @@ ynh_install_php () {
|
||||||
ynh_add_app_dependencies --package="php${phpversion}-fpm"
|
ynh_add_app_dependencies --package="php${phpversion}-fpm"
|
||||||
ynh_add_app_dependencies --package="php$phpversion php${phpversion}-common $package"
|
ynh_add_app_dependencies --package="php$phpversion php${phpversion}-common $package"
|
||||||
|
|
||||||
# Set php7.0 back as the default version for php-cli.
|
# Set the default php version back as the default version for php-cli.
|
||||||
update-alternatives --set php /usr/bin/php7.0
|
update-alternatives --set php /usr/bin/php$YNH_DEFAULT_PHP_VERSION
|
||||||
|
|
||||||
# Pin this extra repository after packages are installed to prevent sury of doing shit
|
# Pin this extra repository after packages are installed to prevent sury of doing shit
|
||||||
ynh_pin_repo --package="*" --pin="origin \"packages.sury.org\"" --priority=200 --name=extra_php_version
|
ynh_pin_repo --package="*" --pin="origin \"packages.sury.org\"" --priority=200 --name=extra_php_version
|
||||||
ynh_pin_repo --package="php7.0*" --pin="origin \"packages.sury.org\"" --priority=600 --name=extra_php_version --append
|
ynh_pin_repo --package="php${$YNH_DEFAULT_PHP_VERSION}*" --pin="origin \"packages.sury.org\"" --priority=600 --name=extra_php_version --append
|
||||||
|
|
||||||
# Advertise service in admin panel
|
# Advertise service in admin panel
|
||||||
yunohost service add php${phpversion}-fpm --log "/var/log/php${phpversion}-fpm.log"
|
yunohost service add php${phpversion}-fpm --log "/var/log/php${phpversion}-fpm.log"
|
||||||
|
@ -229,11 +229,11 @@ ynh_remove_php () {
|
||||||
# Get the version of php used by this app
|
# Get the version of php used by this app
|
||||||
local phpversion=$(ynh_app_setting_get $app phpversion)
|
local phpversion=$(ynh_app_setting_get $app phpversion)
|
||||||
|
|
||||||
if [ "$phpversion" == "7.0" ] || [ -z "$phpversion" ]
|
if [ "$phpversion" == "$YNH_DEFAULT_PHP_VERSION" ] || [ -z "$phpversion" ]
|
||||||
then
|
then
|
||||||
if [ "$phpversion" == "7.0" ]
|
if [ "$phpversion" == "$YNH_DEFAULT_PHP_VERSION" ]
|
||||||
then
|
then
|
||||||
ynh_print_err "Do not use ynh_remove_php to install php7.0"
|
ynh_print_err "Do not use ynh_remove_php to install php$YNH_DEFAULT_PHP_VERSION"
|
||||||
fi
|
fi
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue