diff --git a/check_process b/check_process index d67ff3a..6bff7bc 100644 --- a/check_process +++ b/check_process @@ -14,11 +14,12 @@ setup_private=1 setup_public=1 upgrade=1 + upgrade=1 from_commit=cbb74263e33deb0ec36f99886a2f773e36d40fd9 backup_restore=1 multi_instance=1 incorrect_path=1 port_already_use=0 - change_url=0 + change_url=1 ;; Test avec multisite ; Manifest domain="domain.tld" (DOMAIN) @@ -45,8 +46,7 @@ Level 3=auto # Level 4: https://github.com/YunoHost-Apps/wordpress_ynh/blob/master/conf/sql/single.sql#L1 Level 4=1 -# Level 5: https://github.com/YunoHost-Apps/wordpress_ynh/issues/18 - Level 5=1 + Level 5=auto Level 6=auto Level 7=auto Level 8=0 @@ -55,3 +55,7 @@ ;;; Options Email= Notification=down +;;; Upgrade options + ; commit=cbb74263e33deb0ec36f99886a2f773e36d40fd9 + name=Upgrade 4.8 + manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr_FR&multisite=0&is_public=1& diff --git a/scripts/_common.sh b/scripts/_common.sh index 37c4432..0177d37 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -33,3 +33,19 @@ CHECK_SIZE () { # Vérifie avant chaque backup que l'espace est suffisant ynh_die "Espace nécessaire: $(HUMAN_SIZE $backup_size)" fi } + + +#================================================= +#============= FUTURE YUNOHOST HELPER ============ +#================================================= + +# Delete a file checksum from the app settings +# +# $app should be defined when calling this helper +# +# usage: ynh_remove_file_checksum file +# | arg: file - The file for which the checksum will be deleted +ynh_delete_file_checksum () { + local checksum_setting_name=checksum_${1//[\/ ]/_} # Replace all '/' and ' ' by '_' + ynh_app_setting_delete $app $checksum_setting_name +} diff --git a/scripts/install b/scripts/install index 48e6ff6..c10a556 100644 --- a/scripts/install +++ b/scripts/install @@ -114,8 +114,6 @@ cp ../conf/wp-config.php $final_path/wp-config.php # Change variables in Wordpress configuration ynh_replace_string "__DB_USER__" "$db_name" $final_path/wp-config.php ynh_replace_string "__DB_PWD__" "$db_pwd" $final_path/wp-config.php -ynh_replace_string "__DOMAIN__" "$domain" $final_path/wp-config.php -ynh_replace_string "__PATH__" "$path_url" $final_path/wp-config.php for i in 1 2 3 4 5 6 7 8 do @@ -168,14 +166,6 @@ $wpcli_alias plugin install simple-ldap-login $wpcli_alias plugin install http-authentication $wpcli_alias plugin install companion-auto-update -#================================================= -# LOAD SQL CONFIG -#================================================= - -# Replace variables in sql scripts -ynh_replace_string "__DOMAIN_PATH__" "$domain$path_url" ../conf/sql/*.sql -ynh_replace_string "__DATE__" "$(date +%s)" ../conf/sql/*.sql - #================================================= # SET LANGUAGE #================================================= @@ -200,17 +190,19 @@ then ynh_replace_string "//--MULTISITE2--define" "define" $final_path/wp-config.php ynh_mysql_connect_as $db_name $db_pwd $db_name < ../conf/sql/multisite.sql + plugin_network="--network" else ynh_mysql_connect_as $db_name $db_pwd $db_name < ../conf/sql/single.sql + plugin_network="" fi #================================================= # ACTIVATE WORDPRESS' PLUGINS #================================================= -$wpcli_alias plugin activate simple-ldap-login +$wpcli_alias plugin activate simple-ldap-login $plugin_network # Do not activate http-authentication, this plugin is sometimes unstable -$wpcli_alias plugin activate companion-auto-update +$wpcli_alias plugin activate companion-auto-update $plugin_network #================================================= # STORE THE CHECKSUM OF THE CONFIG FILE