2020-07-26 17:18:19 +07:00
|
|
|
# Helper function to add gearman extension.
|
|
|
|
add_gearman_helper() {
|
2021-03-06 03:07:12 +07:00
|
|
|
add_ppa ondrej/pkg-gearman
|
|
|
|
install_packages libgearman-dev
|
|
|
|
enable_extension gearman extension
|
|
|
|
if ! check_extension gearman; then
|
2020-07-26 17:18:19 +07:00
|
|
|
status="Installed and enabled"
|
2021-03-06 03:07:12 +07:00
|
|
|
if [[ "${version:?}" =~ 5.[3-5] ]]; then
|
|
|
|
pecl_install gearman-1.1.2
|
2020-07-26 17:18:19 +07:00
|
|
|
else
|
2021-03-06 03:07:12 +07:00
|
|
|
install_packages php"${version:?}"-gearman || pecl_install gearman
|
2020-07-26 17:18:19 +07:00
|
|
|
fi
|
2021-03-06 03:07:12 +07:00
|
|
|
enable_extension gearman extension
|
2020-07-26 17:18:19 +07:00
|
|
|
fi
|
|
|
|
}
|
2019-12-14 09:45:39 +07:00
|
|
|
|
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"
|
|
|
|
}
|