Merge pull request #64 from itscaro/kafka

add kafka extension
pull/66/head
Michele Locati 2019-12-19 10:23:16 +01:00 committed by GitHub
commit cc9a37b86b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 74 additions and 0 deletions

View File

@ -42,6 +42,7 @@ pgsql 5.6 7.0 7.1 7.2 7.3 7.4
protobuf 5.6 7.0 7.1 7.2 7.3 7.4 protobuf 5.6 7.0 7.1 7.2 7.3 7.4
pspell 5.6 7.0 7.1 7.2 7.3 7.4 pspell 5.6 7.0 7.1 7.2 7.3 7.4
pthreads 5.6 7.0 pthreads 5.6 7.0
rdkafka 5.6 7.0 7.1 7.2 7.3 7.4
recode 5.6 7.0 7.1 7.2 7.3 recode 5.6 7.0 7.1 7.2 7.3
redis 5.6 7.0 7.1 7.2 7.3 7.4 redis 5.6 7.0 7.1 7.2 7.3 7.4
shmop 5.6 7.0 7.1 7.2 7.3 7.4 shmop 5.6 7.0 7.1 7.2 7.3 7.4

View File

@ -431,6 +431,14 @@ buildRequiredPackageLists () {
pthreads@alpine) pthreads@alpine)
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $PHPIZE_DEPS" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $PHPIZE_DEPS"
;; ;;
rdkafka@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent librdkafka"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $PHPIZE_DEPS librdkafka-dev"
;;
rdkafka@debian)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent librdkafka++1"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile librdkafka-dev"
;;
recode@alpine) recode@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent recode" buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent recode"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile recode-dev" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile recode-dev"
@ -639,6 +647,52 @@ installRequiredPackages () {
esac esac
} }
# Get the version of an installed APT/APK package
#
# Arguments:
# $1: the name of the installed package
#
# Output:
# The numeric part of the package version, with from 1 to 3 numbers
#
# Example:
# 1
# 1.2
# 1.2.3
getInstalledPackageVersion() {
case "$(getDistro)" in
alpine)
apk info "$1" | head -n1 | cut -c $(( ${#1} + 2 ))- | grep -o -E '^[0-9]+(\.[0-9]+){0,2}'
;;
debian)
dpkg-query --showformat='${Version}' --show "$1" 2>/dev/null | grep -o -E '^[0-9]+(\.[0-9]+){0,2}'
;;
esac
}
# Compare two versions
#
# Arguments:
# $1: the first version
# $2: the second version
#
# Output
# -1 if $1 is less than $2
# 0 if $1 is the same as $2
# 1 if $1 is greater than $2
compareVersions() {
compareVersions_v1="$1.0.0"
compareVersions_v2="$2.0.0"
compareVersions_vMin="$(printf '%s\n%s' "${compareVersions_v1}" "${compareVersions_v2}" | sort -t '.' -n -k1,1 -k2,2 -k3,3 | head -n 1)"
if test "$compareVersions_vMin" != "$compareVersions_v1"; then
echo '1'
elif test "$compareVersions_vMin" = "$compareVersions_v2"; then
echo '0'
else
echo '-1'
fi
}
# Install a bundled PHP module given its handle # Install a bundled PHP module given its handle
# #
# Arguments: # Arguments:
@ -893,6 +947,25 @@ installPECLModule () {
installPECLModule_actual="$2-2.0.10" installPECLModule_actual="$2-2.0.10"
fi fi
;; ;;
rdkafka)
installPECLModule_tmp=
case "$(getDistro)" in
alpine)
installPECLModule_tmp='librdkafka'
;;
debian)
installPECLModule_tmp='librdkafka++1'
;;
esac
if test -n "$installPECLModule_tmp"; then
installPECLModule_tmp="$(getInstalledPackageVersion "$installPECLModule_tmp")"
if test -n "$installPECLModule_tmp"; then
if test $(compareVersions "$installPECLModule_tmp" '0.11.0') -lt 0; then
installPECLModule_actual="$2-3.1.3"
fi
fi
fi
;;
redis) redis)
if test $1 -le 506; then if test $1 -le 506; then
installPECLModule_actual="$2-4.3.0" installPECLModule_actual="$2-4.3.0"