Skip to content

Commit

Permalink
Fix installing redis on PHP 7.0/7.1, add support for msgpack/lz4 to r…
Browse files Browse the repository at this point in the history
…edis on PHP 7.2+ (#801)
  • Loading branch information
mlocati authored Sep 12, 2023
1 parent ae0abc8 commit 820bda4
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions install-php-extensions
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,10 @@ buildRequiredPackageLists() {
;;
esac
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zstd-dev"
if test $PHP_MAJMIN_VERSION -ge 702; then
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent lz4-libs"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile lz4-dev"
fi
fi
;;
redis@debian)
Expand All @@ -1188,6 +1192,10 @@ buildRequiredPackageLists() {
;;
esac
fi
if test $PHP_MAJMIN_VERSION -ge 702; then
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liblz4-1"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liblz4-dev"
fi
;;
relay@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent lz4-libs zstd-libs"
Expand Down Expand Up @@ -3239,19 +3247,21 @@ installRemoteModule() {
if test -z "$installRemoteModule_version"; then
if test $PHP_MAJMIN_VERSION -le 506; then
installRemoteModule_version=4.3.0
elif test $PHP_MAJMIN_VERSION -le 701; then
installRemoteModule_version=5.3.7
fi
else
installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")"
fi
# Enable igbinary serializer support?
if php --ri igbinary >/dev/null 2>/dev/null; then
addConfigureOption 'enable-redis-igbinary' 'yes'
addConfigureOption enable-redis-igbinary yes
else
addConfigureOption 'enable-redis-igbinary' 'no'
addConfigureOption enable-redis-igbinary no
fi
# Enable lzf compression support?
addConfigureOption 'enable-redis-lzf' 'yes'
if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" '5.0.0') -ge 0; then
addConfigureOption enable-redis-lzf yes
if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 5.0.0) -ge 0; then
if ! test -e /usr/include/zstd.h || ! test -e /usr/lib/libzstd.so -o -e "/usr/lib/$TARGET_TRIPLET/libzstd.so"; then
installRemoteModule_zstdVersion=1.4.4
installRemoteModule_zstdVersionMajor=$(echo $installRemoteModule_zstdVersion | cut -d. -f1)
Expand All @@ -3267,7 +3277,19 @@ installRemoteModule() {
cd - >/dev/null
fi
# Enable zstd compression support?
addConfigureOption 'enable-redis-zstd' 'yes'
addConfigureOption enable-redis-zstd yes
if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 6.0.0) -ge 0; then
# Enable msgpack serializer support?
if php --ri msgpack >/dev/null 2>/dev/null; then
addConfigureOption enable-redis-msgpack yes
else
addConfigureOption enable-redis-msgpack no
fi
# Enable lz4 compression?
addConfigureOption enable-redis-lz4 yes
# Use system liblz4?
addConfigureOption with-liblz4 yes
fi
fi
;;
relay)
Expand Down

0 comments on commit 820bda4

Please sign in to comment.