From 1dc7c0782b8e256ecc4ccf0423e31deb4e9558db Mon Sep 17 00:00:00 2001 From: Nicolas Olive Date: Fri, 5 Dec 2025 13:35:40 +0100 Subject: [PATCH] support php 8.5 --- Makefile | 15 ++++++++------- build/build-image.sh | 26 +++++++++++++++----------- composer.json | 2 +- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index d240650..28df8a3 100644 --- a/Makefile +++ b/Makefile @@ -3,17 +3,18 @@ LATEST_PHP := 8.0 3.1.1 COVERAGE_PHP := 7.4 3.1.1 -PHP_8_3 := 8.3 3.3.2 +PHP_8_5 := 8.5 3.5.0alpha3 define PHP_VERSIONS "7.2 3.1.1"\ "7.3 3.1.1"\ "7.4 3.1.1"\ "8.0 3.1.1"\ -"8.1 3.1.1"\ -"8.2 3.2.0"\ -"8.3 3.3.2"\ -"8.4 3.4.0beta1" +"8.1 3.4.7"\ +"8.2 3.4.7"\ +"8.3 3.4.7"\ +"8.4 3.4.7"\ +"8.5 3.5.0alpha3" endef define DOCKER_RUN @@ -34,7 +35,7 @@ build: composer-update cs-check phpstan tests-all ## Run all necessary stuff bef tests: ## Run tests on recent PHP version. Pass args to phpunit via ARGS="" - @$(call DOCKER_RUN,$(PHP_8_3),composer tests -- $(ARGS)) + @$(call DOCKER_RUN,$(PHP_8_5),composer tests -- $(ARGS)) tests-coverage: ## Runs tests and creates ./clover.xml. Pass args to phpunit via ARGS="" @@ -64,7 +65,7 @@ cs-fix: ## Fix code style performance-tests: ## Run performance tests - @$(call DOCKER_RUN,$(PHP_8_3),composer performance-tests) + @$(call DOCKER_RUN,$(PHP_8_5),composer performance-tests) composer-update: ## Validate composer.json contents diff --git a/build/build-image.sh b/build/build-image.sh index f541f8f..4698f61 100755 --- a/build/build-image.sh +++ b/build/build-image.sh @@ -19,13 +19,20 @@ docker ps --all --format "{{.Names}}" | grep "$CONTAINER_NAME" && docker rm -f " >&2 echo "Building $CONTAINER_NAME from $FROM_IMAGE" +# Use pecl for PHP < 8.1, pie for PHP >= 8.1 +if [ "$(printf '%s\n' "8.1" "$PHP_MINOR" | sort -V | head -n1)" = "8.1" ]; then + PIE_COPY="COPY --from=ghcr.io/php/pie:bin /pie /usr/bin/pie" + XDEBUG_INSTALL="pie install xdebug/xdebug:$XDEBUG_VERSION" +else + PIE_COPY="" + XDEBUG_INSTALL="pecl install xdebug-$XDEBUG_VERSION && docker-php-ext-enable xdebug" +fi + printf " FROM $FROM_IMAGE - RUN apk update && apk upgrade - # https://stackoverflow.com/questions/76507083/pecl-install-no-releases-available#comment136513209_76651916 - RUN rm /etc/ssl/certs/ca-cert-DST_Root_CA_X3.pem || true \ - && cat /etc/ssl/certs/*.pem > /etc/ssl/certs/ca-certificates.crt \ - && cat /etc/ssl/certs/*.pem > /etc/ssl/cert.pem + + $PIE_COPY + RUN apk add \ autoconf \ g++ \ @@ -33,12 +40,9 @@ printf " make \ bash \ linux-headers \ - && wget http://pear.php.net/go-pear.phar && php go-pear.phar \ - && pecl install xdebug-$XDEBUG_VERSION \ - && docker-php-ext-enable xdebug \ - && docker-php-ext-enable opcache \ - && wget https://getcomposer.org/download/2.8.1/composer.phar -O /usr/local/bin/composer \ + && $XDEBUG_INSTALL \ + && wget https://getcomposer.org/download/2.8.12/composer.phar -O /usr/local/bin/composer \ && chmod +x /usr/local/bin/composer " | docker build --quiet --tag "$CONTAINER_NAME" - > /dev/null -echo "$CONTAINER_NAME" +echo "$CONTAINER_NAME" \ No newline at end of file diff --git a/composer.json b/composer.json index e93a746..7aafac7 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "sort-packages": true }, "require": { - "php": "7.2 - 8.4" + "php": "7.2 - 8.5" }, "require-dev": { "ext-json": "*",