mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Force php to its intended version in ynh_spawn_app_shell
This commit is contained in:
parent
4b4ce9aef6
commit
ed1b5e567b
1 changed files with 8 additions and 0 deletions
|
@ -164,6 +164,14 @@ ynh_spawn_app_shell() {
|
|||
[ -n "$env_var" ] && export $env_var;
|
||||
export HOME=$install_dir;
|
||||
|
||||
# Force `php` to its intended version
|
||||
local phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||
if [ -n "$phpversion" ]
|
||||
then
|
||||
eval "php() { php${phpversion} \"\$@\"; }"
|
||||
export -f php
|
||||
fi
|
||||
|
||||
# Source the EnvironmentFiles from the app's service
|
||||
local env_files=(`systemctl show $app.service -p "EnvironmentFiles" --value`)
|
||||
if [ ${#env_files[*]} -gt 0 ]
|
||||
|
|
Loading…
Add table
Reference in a new issue