diff --git a/scripts/_common.sh b/scripts/_common.sh index 999b76a..8a2500b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -8,7 +8,7 @@ YNH_PHP_VERSION="7.3" YNH_COMPOSER_VERSION="2.0.4" -extra_php_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-pdo php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-xsl php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-sqlite3" +extra_php_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-pdo php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-xsl php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-mysql" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index edbead6..464f4ac 100755 --- a/scripts/install +++ b/scripts/install @@ -48,7 +48,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin -ynh_app_setting_set --app=$app --key=is_public --value=$is_public ynh_app_setting_set --app=$app --key=registration --value=$registration ynh_app_setting_set --app=$app --key=random_key --value=$random_key @@ -94,6 +93,7 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 # Create a dedicated php-fpm config ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC SETUP @@ -122,11 +122,11 @@ ynh_add_config --template="../conf/.env.mysql" --destination="$final_path/.env" #================================================= ynh_script_progression --message="Building Kimai2..." --weight=1 -ynh_install_composer --phpversion="${YNH_PHP_VERSION}" --workdir="$final_path" --install_args="--optimize-autoloader" -ynh_composer_exec --phpversion="${YNH_PHP_VERSION}" --workdir="$final_path" --commands="require laminas/laminas-ldap" +ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" --install_args="--optimize-autoloader" +ynh_composer_exec --phpversion="$phpversion" --workdir="$final_path" --commands="require laminas/laminas-ldap" pushd "$final_path" - php${YNH_PHP_VERSION} bin/console kimai:install -n + php$phpversion bin/console kimai:install -n popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 6061a33..4c1c6b9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,6 +22,7 @@ admin=$(ynh_app_setting_get --app=$app --key=admin) final_path=$(ynh_app_setting_get --app=$app --key=final_path) registration=$(ynh_app_setting_get --app=$app --key=registration) random_key=$(ynh_app_setting_get --app=$app --key=random_key) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK VERSION @@ -70,7 +71,7 @@ if ! ynh_permission_exists --permission="admin"; then fi if ! ynh_permission_exists --permission="super_admin"; then - ynh_permission_create --permission="super_admin" --allowed "$admin" + ynh_permission_create --permission="super_admin" --allowed="$admin" fi #================================================= @@ -146,6 +147,7 @@ ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencie ynh_script_progression --message="Configuring Kimai2..." local_conf="$final_path/config/packages/local.yaml" + ynh_backup_if_checksum_is_different --file="$local_conf" cp ../conf/local.yaml $local_conf ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$local_conf" @@ -164,11 +166,11 @@ ynh_add_config --template="../conf/.env.mysql" --destination="$final_path/.env" #================================================= ynh_script_progression --message="Upgrading Kimai2..." -ynh_install_composer --phpversion="${YNH_PHP_VERSION}" --workdir="$final_path" --install_args="--optimize-autoloader" -ynh_composer_exec --phpversion="${YNH_PHP_VERSION}" --workdir="$final_path" --commands="require laminas/laminas-ldap" +ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" --install_args="--optimize-autoloader" +ynh_composer_exec --phpversion="$phpversion" --workdir="$final_path" --commands="require laminas/laminas-ldap" pushd "$final_path" - php${YNH_PHP_VERSION} bin/console kimai:update -n + php$phpversion bin/console kimai:update -n popd #=================================================