Refactor extension functions to add_extensions scripts

This commit is contained in:
Shivam Mathur
2022-01-02 17:21:14 +05:30
parent d189609ea9
commit 2fd8046c9d
34 changed files with 359 additions and 358 deletions

View File

@ -0,0 +1,22 @@
# Helper function to add gearman extension.
add_gearman_helper() {
add_ppa ondrej/pkg-gearman
install_packages libgearman-dev
enable_extension gearman extension
if ! check_extension gearman; then
status="Installed and enabled"
if [[ "${version:?}" =~ 5.[3-5] ]]; then
pecl_install gearman-1.1.2
else
install_packages php"${version:?}"-gearman || pecl_install gearman
fi
enable_extension gearman extension
fi
}
# Function to add gearman extension.
add_gearman() {
status="Enabled"
add_gearman_helper >/dev/null 2>&1
add_extension_log "gearman" "$status"
}