1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nextcloud_ynh.git synced 2024-09-03 19:55:57 +02:00
This commit is contained in:
Éric Gaspar 2023-06-11 12:35:31 +02:00
parent ee2b79ac13
commit b6091c4f70
3 changed files with 25 additions and 8 deletions

View file

@ -4,14 +4,6 @@
# COMMON FUCTIONS
#=================================================
# Define a function to execute commands with `occ`
exec_occ() {
(cd "$install_dir" && ynh_exec_as "$app" \
php${phpversion} --define apc.enable_cli=1 occ --no-interaction --no-ansi "$@")
}
#=================================================
# Define a function to add an external storage
# Create the external storage for the given folders and enable sharing
create_external_storage() {

View file

@ -79,6 +79,12 @@ ynh_add_nginx_config
#=================================================
ynh_script_progression --message="Installing $app..." --weight=30
# Define a function to execute commands with `occ`
exec_occ() {
(cd "$install_dir" && ynh_exec_as "$app" \
php${phpversion} --define apc.enable_cli=1 occ --no-interaction --no-ansi "$@")
}
# Set write access for the following commands
chown -R $app: "$install_dir" "$data_dir"

View file

@ -112,6 +112,25 @@ exec_occ() {
php$NEXTCLOUD_PHP_VERSION --define apc.enable_cli=1 occ --no-interaction --no-ansi "$@")
}
# Define a function to execute commands with `occ`
exec_occ() {
# Backward compatibility to upgrade from older versions
if [ $current_major_version = "last" ]
then
NEXTCLOUD_PHP_VERSION=$phpversion
elif [ $current_major_version -ge 24 ]
then
NEXTCLOUD_PHP_VERSION="8.0"
elif [ $current_major_version -ge 15 ]
then
NEXTCLOUD_PHP_VERSION="7.4"
else
NEXTCLOUD_PHP_VERSION="7.0"
fi
(cd "$install_dir" && ynh_exec_as "$app" \
php$NEXTCLOUD_PHP_VERSION --define apc.enable_cli=1 occ --no-interaction --no-ansi "$@")
}
#=================================================
# HANDLE DATABASE MIGRATION
#=================================================