ericgaspar 3 سال پیش
والد
کامیت
a2057eb91c
2فایلهای تغییر یافته به همراه10 افزوده شده و 1 حذف شده
  1. 1 0
      scripts/install
  2. 9 1
      scripts/upgrade

+ 1 - 0
scripts/install

@@ -23,6 +23,7 @@ ynh_abort_if_errors
 domain=$YNH_APP_ARG_DOMAIN
 path_url=$YNH_APP_ARG_PATH
 is_public=$YNH_APP_ARG_IS_PUBLIC
+phpversion=$YNH_PHP_VERSION
 
 app=$YNH_APP_INSTANCE_NAME
 

+ 9 - 1
scripts/upgrade

@@ -21,6 +21,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
 admin=$(ynh_app_setting_get --app=$app --key=admin)
 final_path=$(ynh_app_setting_get --app=$app --key=final_path)
 db_name=$(ynh_app_setting_get --app=$app --key=db_name)
+phpversion=$YNH_PHP_VERSION
 
 #=================================================
 # CHECK VERSION
@@ -86,7 +87,7 @@ then
 	ynh_script_progression --message="Upgrading source files..." --weight=3
 
 	# Download, check integrity, uncompress and patch the source from app.src
-	ynh_setup_source --dest_dir="$final_path"
+	ynh_setup_source --dest_dir="$final_path" --keep="$final_path/img $final_path/override"
 fi
 
 chmod 750 "$final_path"
@@ -116,6 +117,13 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1
 # Create a dedicated PHP-FPM config
 ynh_add_fpm_config
 
+#=================================================
+# PHP-FPM CONFIGURATION
+#=================================================
+ynh_script_progression --message="Upgrading database..." --weight=1
+
+php$phpversion $final_path/install/upgrade/upgrade.php
+
 #=================================================
 # RELOAD NGINX
 #=================================================