2018-06-17 00:50:26 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-06-23 01:22:06 +02:00
|
|
|
#=================================================
|
|
|
|
# COMMON VARIABLES
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# dependencies used by the app
|
2020-06-11 00:45:03 +02:00
|
|
|
pkg_dependencies=""
|
|
|
|
|
|
|
|
YNH_PHP_VERSION="7.3"
|
|
|
|
|
2020-06-11 03:39:52 +02:00
|
|
|
extra_php_dependencies="php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-opcache php${YNH_PHP_VERSION}-ldap"
|
2020-06-11 00:45:03 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# PERSONAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# EXPERIMENTAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# FUTURE OFFICIAL HELPERS
|
|
|
|
#=================================================
|
2019-06-23 01:22:06 +02:00
|
|
|
|
2018-06-17 00:50:26 +02:00
|
|
|
# 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
|
|
|
|
}
|
|
|
|
|
|
|
|
# Execute a command as another user
|
|
|
|
# usage: exec_as USER COMMAND [ARG ...]
|
|
|
|
exec_as() {
|
|
|
|
local USER=$1
|
|
|
|
shift 1
|
|
|
|
|
|
|
|
if [[ $USER = $(whoami) ]]; then
|
|
|
|
eval $@
|
|
|
|
else
|
|
|
|
# use sudo twice to be root and be allowed to use another user
|
|
|
|
sudo sudo -u "$USER" $@
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Composer helpers
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
sudo_path () {
|
|
|
|
sudo env "PATH=$PATH" $@
|
|
|
|
}
|