diff --git a/README.md b/README.md
index dca2df6..281148e 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ It shall NOT be edited by hand.
# Quizzes for YunoHost
-[](https://dash.yunohost.org/appci/app/quizzes)  
+[](https://dash.yunohost.org/appci/app/quizzes)  
[](https://install-app.yunohost.org/?app=quizzes)
*[Lire ce readme en français.](./README_fr.md)*
@@ -20,11 +20,9 @@ Multiple choice quiz platform with results analysis interface
**Shipped version:** 1.3.0~ynh1
-
## Screenshots
-
-
+
## Disclaimers / important information
@@ -36,20 +34,21 @@ test
```
## Documentation and resources
-* Official app website: https://github.com/hipay/quizzes/
-* Upstream app code repository: https://github.com/hipay/quizzes/
-* YunoHost documentation for this app: https://yunohost.org/app_quizzes
-* Report a bug: https://github.com/YunoHost-Apps/quizzes_ynh/issues
+* Official app website:
+* Upstream app code repository:
+* YunoHost documentation for this app:
+* Report a bug:
## Developer info
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/quizzes_ynh/tree/testing).
To try the testing branch, please proceed like that.
-```
+
+``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/quizzes_ynh/tree/testing --debug
or
sudo yunohost app upgrade quizzes -u https://github.com/YunoHost-Apps/quizzes_ynh/tree/testing --debug
```
-**More info regarding app packaging:** https://yunohost.org/packaging_apps
\ No newline at end of file
+**More info regarding app packaging:**
diff --git a/README_fr.md b/README_fr.md
index 7905c21..d13a82a 100644
--- a/README_fr.md
+++ b/README_fr.md
@@ -1,10 +1,14 @@
+
+
# Quizzes pour YunoHost
-[](https://dash.yunohost.org/appci/app/quizzes)  
+[](https://dash.yunohost.org/appci/app/quizzes)  
[](https://install-app.yunohost.org/?app=quizzes)
*[Read this readme in english.](./README.md)*
-*[Lire ce readme en français.](./README_fr.md)*
> *Ce package vous permet d'installer Quizzes rapidement et simplement sur un serveur YunoHost.
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
@@ -13,14 +17,12 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
Plate-forme de quizzes à choix multiples (QCM) avec interface d'analyse des résultats
-**Version incluse :** 1.3.0~ynh1
-
+**Version incluse :** 1.3.0~ynh1
## Captures d'écran
-
-
+
## Avertissements / informations importantes
@@ -32,20 +34,21 @@ test
```
## Documentations et ressources
-* Site officiel de l'app : https://github.com/hipay/quizzes/
-* Dépôt de code officiel de l'app : https://github.com/hipay/quizzes/
-* Documentation YunoHost pour cette app : https://yunohost.org/app_quizzes
-* Signaler un bug : https://github.com/YunoHost-Apps/quizzes_ynh/issues
+* Site officiel de l'app :
+* Dépôt de code officiel de l'app :
+* Documentation YunoHost pour cette app :
+* Signaler un bug :
## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/quizzes_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit.
-```
+
+``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/quizzes_ynh/tree/testing --debug
ou
sudo yunohost app upgrade quizzes -u https://github.com/YunoHost-Apps/quizzes_ynh/tree/testing --debug
```
-**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps
\ No newline at end of file
+**Plus d'infos sur le packaging d'applications :**
diff --git a/check_process b/check_process
index c3b3e73..1636a1e 100644
--- a/check_process
+++ b/check_process
@@ -1,10 +1,7 @@
;; Test complet
; Manifest
domain="domain.tld"
- path="/path"
- admin="john"
is_public=1
- password="1Strong-Password"
; Checks
pkg_linter=1
setup_sub_dir=0
diff --git a/conf/nginx.conf b/conf/nginx.conf
index 255752b..d86f108 100644
--- a/conf/nginx.conf
+++ b/conf/nginx.conf
@@ -1,4 +1,4 @@
-location / {
+location __PATH__/ {
# Path to source
alias __FINALPATH__/web/;
diff --git a/doc/.DS_Store b/doc/.DS_Store
deleted file mode 100644
index c90376b..0000000
Binary files a/doc/.DS_Store and /dev/null differ
diff --git a/doc/screenshots/.DS_Store b/doc/screenshots/.DS_Store
deleted file mode 100644
index 5008ddf..0000000
Binary files a/doc/screenshots/.DS_Store and /dev/null differ
diff --git a/scripts/install b/scripts/install
index c0cfec0..8d560f6 100755
--- a/scripts/install
+++ b/scripts/install
@@ -76,14 +76,6 @@ chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
-#=================================================
-# NGINX CONFIGURATION
-#=================================================
-ynh_script_progression --message="Configuring NGINX web server..." --weight=1
-
-# Create a dedicated NGINX config
-ynh_add_nginx_config
-
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
@@ -92,6 +84,14 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
# Create a dedicated PHP-FPM config
ynh_add_fpm_config
+#=================================================
+# NGINX CONFIGURATION
+#=================================================
+ynh_script_progression --message="Configuring NGINX web server..." --weight=1
+
+# Create a dedicated NGINX config
+ynh_add_nginx_config
+
#=================================================
# SPECIFIC SETUP
#=================================================
@@ -101,6 +101,10 @@ ynh_script_progression --message="Installing $app with Composer..." --weight=5
ynh_install_composer --install_args="--ignore-platform-reqs" 2>&1
+pushd $final_path
+ patch --strip=1 < $YNH_APP_BASEDIR/sources/app-array_key_exists.patch
+popd
+
#=================================================
# ADD A CONFIGURATION
#=================================================
@@ -140,6 +144,8 @@ ynh_script_progression --message="Configuring permissions..." --weight=1
# Make app public if necessary
if [ $is_public -eq 1 ]
then
+ # Everyone can access the app.
+ # The "main" permission is automatically created before the install script.
ynh_permission_update --permission="main" --add="visitors"
fi
diff --git a/scripts/remove b/scripts/remove
index 13b0c7c..dfcbda5 100755
--- a/scripts/remove
+++ b/scripts/remove
@@ -64,7 +64,7 @@ ynh_remove_app_dependencies
#=================================================
# REMOVE VARIOUS FILES
#=================================================
-ynh_script_progression --message="Removing various files..."
+ynh_script_progression --message="Removing various files..." --weight=1
# Remove the log files
ynh_secure_remove --file="/var/log/$app"
diff --git a/scripts/restore b/scripts/restore
index 9e3de02..8cb6d80 100755
--- a/scripts/restore
+++ b/scripts/restore
@@ -42,13 +42,6 @@ test ! -d $final_path \
#=================================================
# STANDARD RESTORATION STEPS
-#=================================================
-# RESTORE THE NGINX CONFIGURATION
-#=================================================
-ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1
-
-ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
-
#=================================================
# RECREATE THE DEDICATED USER
#=================================================
@@ -68,6 +61,14 @@ chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
+#=================================================
+# REINSTALL DEPENDENCIES
+#=================================================
+ynh_script_progression --message="Reinstalling dependencies..." --weight=1
+
+# Define and install dependencies
+ynh_install_app_dependencies $pkg_dependencies
+
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
@@ -76,12 +77,11 @@ ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weig
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
#=================================================
-# REINSTALL DEPENDENCIES
+# RESTORE THE NGINX CONFIGURATION
#=================================================
-ynh_script_progression --message="Reinstalling dependencies..." --weight=1
+ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1
-# Define and install dependencies
-ynh_install_app_dependencies $pkg_dependencies
+ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
diff --git a/scripts/upgrade b/scripts/upgrade
index e2a5b67..21d255e 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -23,7 +23,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# CHECK VERSION
#=================================================
-ynh_script_progression --message="Checking version..."
+ynh_script_progression --message="Checking version..." --weight=1
upgrade_type=$(ynh_check_app_version_changed)
@@ -62,20 +62,10 @@ then
ynh_setup_source --dest_dir="$final_path"
fi
-ynh_install_composer --install_args="--ignore-platform-reqs" 2>&1
-
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
-#=================================================
-# NGINX CONFIGURATION
-#=================================================
-ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
-
-# Create a dedicated NGINX config
-ynh_add_nginx_config
-
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
@@ -91,6 +81,27 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2
# Create a dedicated PHP-FPM config
ynh_add_fpm_config
+#=================================================
+# NGINX CONFIGURATION
+#=================================================
+ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
+
+# Create a dedicated NGINX config
+ynh_add_nginx_config
+
+#=================================================
+# SPECIFIC UPGRADE
+#=================================================
+# INSTALL LYCHEE WITH COMPOSER
+#=================================================
+ynh_script_progression --message="Installing $app with Composer..." --weight=5
+
+ynh_install_composer --install_args="--ignore-platform-reqs" 2>&1
+
+pushd $final_path
+ patch --strip=1 < $YNH_APP_BASEDIR/sources/app-array_key_exists.patch
+popd
+
#=================================================
# UPDATE A CONFIG FILE
#=================================================
diff --git a/sources/app-array_key_exists.patch b/sources/app-array_key_exists.patch
new file mode 100644
index 0000000..c69b85b
--- /dev/null
+++ b/sources/app-array_key_exists.patch
@@ -0,0 +1,11 @@
+--- a/vendor/twig/twig/lib/Twig/Template.php 2022-09-05 02:54:39.800617851 +0200
++++ a/vendor/twig/twig/lib/Twig/Template.php 2022-09-05 03:54:48.000000000 +0200
+@@ -387,7 +387,7 @@
+
+ // object property
+ if (Twig_TemplateInterface::METHOD_CALL !== $type) {
+- if (isset($object->$item) || array_key_exists((string) $item, $object)) {
++ if (isset($object->$item)) {
+ if ($isDefinedTest) {
+ return true;
+ }
diff --git a/sources/extra_files/app/.gitignore b/sources/extra_files/app/.gitignore
deleted file mode 100644
index 783a4ae..0000000
--- a/sources/extra_files/app/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*~
-*.sw[op]
diff --git a/sources/patches/.gitignore b/sources/patches/.gitignore
deleted file mode 100644
index 783a4ae..0000000
--- a/sources/patches/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*~
-*.sw[op]