setup-php/src/scripts/ext/gearman.sh

24 lines
772 B
Bash
Raw Normal View History

2020-07-26 17:18:19 +07:00
# Helper function to add gearman extension.
add_gearman_helper() {
sudo "${debconf_fix:?}" add-apt-repository ppa:ondrej/pkg-gearman -y
if [ -e "${ext_dir:?}/gearman.so" ] && [ "$DISTRIB_RELEASE" != "16.04" ]; then
${apt_install:?} libgearman-dev
echo "extension=gearman.so" | sudo tee -a "${scan_dir:?}/20-gearman.ini" >/dev/null 2>&1
else
status="Installed and enabled"
if [ "$DISTRIB_RELEASE" = "16.04" ]; then
sudo "${debconf_fix:?}" apt-get update -y
${apt_install:?} php"${version:?}"-gearman
else
${apt_install:?} libgearman-dev php"${version:?}"-gearman
fi
fi
}
2020-07-26 17:18:19 +07:00
# Function to add gearman extension.
add_gearman() {
status="Enabled"
add_gearman_helper >/dev/null 2>&1
add_extension_log "gearman" "$status"
}