From 529a33f1a06b1aacf8c94a6b1a0277d12f5f890e Mon Sep 17 00:00:00 2001 From: cytopia Date: Sat, 4 Jan 2020 19:18:35 +0100 Subject: [PATCH] Fix phpredis for PHP 8.0 --- Dockerfiles/mods/Dockerfile-7.4 | 16 ++++------------ Dockerfiles/mods/Dockerfile-8.0 | 3 ++- Makefile | 1 + build/ansible/group_vars/all/mods.yml | 13 +++---------- 4 files changed, 10 insertions(+), 23 deletions(-) diff --git a/Dockerfiles/mods/Dockerfile-7.4 b/Dockerfiles/mods/Dockerfile-7.4 index 4bfe4f9..57520fd 100644 --- a/Dockerfiles/mods/Dockerfile-7.4 +++ b/Dockerfiles/mods/Dockerfile-7.4 @@ -473,18 +473,10 @@ RUN set -eux \ # -------------------- Installing PHP Extension: redis -------------------- RUN set -eux \ - # Installation: Version specific - # Type: GIT extension - && git clone https://github.com/phpredis/phpredis /tmp/redis \ - && cd /tmp/redis \ - # Custom: Branch - && git checkout $(git for-each-ref --format='%(refname)' refs/tags | grep -E 'tags/[.0-9]+$' | sed 's|.*tags/||g' | sort -V | tail -1) \ - # Custom: Install command - && phpize \ -&& ./configure --enable-redis \ -&& make -j$(getconf _NPROCESSORS_ONLN) \ -&& make install \ - \ + # Installation: Generic + # Type: PECL extension + # Default: Pecl command + && pecl install redis \ # Enabling && docker-php-ext-enable redis \ && true diff --git a/Dockerfiles/mods/Dockerfile-8.0 b/Dockerfiles/mods/Dockerfile-8.0 index eedfc79..643e803 100644 --- a/Dockerfiles/mods/Dockerfile-8.0 +++ b/Dockerfiles/mods/Dockerfile-8.0 @@ -364,7 +364,8 @@ RUN set -eux \ # Custom: Branch && git checkout $(git for-each-ref --format='%(refname)' refs/tags | grep -E 'tags/[.0-9]+$' | sed 's|.*tags/||g' | sort -V | tail -1) \ # Custom: Install command - && phpize \ + && sed -i'' 's/, ZSTR_LEN(ra->algorithm)//g' redis_array_impl.c \ +&& phpize \ && ./configure --enable-redis \ && make -j$(getconf _NPROCESSORS_ONLN) \ && make install \ diff --git a/Makefile b/Makefile index a8139b1..a49e1de 100644 --- a/Makefile +++ b/Makefile @@ -178,6 +178,7 @@ build-work: # REBUILD TARGETS # ------------------------------------------------------------------------------------------------- +rebuild-base: _pull-root-image rebuild-base: NO_CACHE=--no-cache rebuild-base: build-base diff --git a/build/ansible/group_vars/all/mods.yml b/build/ansible/group_vars/all/mods.yml index 2124946..25a7c82 100644 --- a/build/ansible/group_vars/all/mods.yml +++ b/build/ansible/group_vars/all/mods.yml @@ -811,21 +811,14 @@ extensions_available: 5.6: type: pecl version: 4.3.0 - 7.4: - type: git - git_url: https://github.com/phpredis/phpredis - git_ref: $(git for-each-ref --format='%(refname)' refs/tags | grep -E 'tags/[.0-9]+$' | sed 's|.*tags/||g' | sort -V | tail -1) - command: | - phpize \ - && ./configure --enable-redis \ - && make -j$(getconf _NPROCESSORS_ONLN) \ - && make install \ 8.0: type: git git_url: https://github.com/phpredis/phpredis git_ref: $(git for-each-ref --format='%(refname)' refs/tags | grep -E 'tags/[.0-9]+$' | sed 's|.*tags/||g' | sort -V | tail -1) + # TODO: This is a nasty work-around to fix current phpredis implementation for PHP 8.0 command: | - phpize \ + sed -i'' 's/, ZSTR_LEN(ra->algorithm)//g' redis_array_impl.c \ + && phpize \ && ./configure --enable-redis \ && make -j$(getconf _NPROCESSORS_ONLN) \ && make install \