diff --git a/scripts/_common.sh b/scripts/_common.sh index 0df6e80..5ceeca8 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -10,6 +10,13 @@ YNH_COMPOSER_VERSION="2.4.3" # PERSONAL HELPERS #================================================= +_fix_php_version() { + mkdir -p "$install_dir/phppath" + ln -s "/usr/bin/php$phpversion" "$install_dir/phppath/php" + PATH="$install_dir/phppath:$PATH" "$@" + ynh_secure_remove --file="$install_dir/phppath" +} + #================================================= # EXPERIMENTAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index aea5a6c..c87a7ea 100644 --- a/scripts/install +++ b/scripts/install @@ -37,7 +37,7 @@ ynh_script_progression --message="Building Movim..." ynh_install_composer COMPOSER_ALLOW_SUPERUSER=1 ynh_composer_exec --commands="install --no-dev" -COMPOSER_ALLOW_SUPERUSER=1 ynh_composer_exec --commands="movim:migrate" +COMPOSER_ALLOW_SUPERUSER=1 _fix_php_version ynh_composer_exec --commands="movim:migrate" chown -R "$app:www-data" "$install_dir" diff --git a/scripts/upgrade b/scripts/upgrade index e30fdac..5297bc3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -44,7 +44,7 @@ ynh_exec_warn_less ynh_install_composer ynh_exec_warn_less COMPOSER_ALLOW_SUPERUSER=1 ynh_composer_exec --commands="config --global discard-changes true --quiet" ynh_exec_warn_less COMPOSER_ALLOW_SUPERUSER=1 ynh_composer_exec --commands="update --no-interaction --quiet" -ynh_exec_warn_less COMPOSER_ALLOW_SUPERUSER=1 ynh_composer_exec --commands="movim:migrate --quiet" +ynh_exec_warn_less COMPOSER_ALLOW_SUPERUSER=1 _fix_php_version ynh_composer_exec --commands="movim:migrate --quiet" chown -R "$app:www-data" "$install_dir"