From 1150fc5ecddb1212e82afc7d7997a1af93ef130f Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Tue, 23 Jan 2024 10:30:48 +0100 Subject: [PATCH] Add PHP8.3 support for Smarty 4.3. --- .github/workflows/ci.yml | 5 ++++- CHANGELOG.md | 3 +++ docker-compose.yml | 5 +++++ libs/sysplugins/smarty_internal_errorhandler.php | 2 +- run-tests-for-all-php-versions.sh | 4 +++- utilities/testrunners/php83/Dockerfile | 10 ++++++++++ 6 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 utilities/testrunners/php83/Dockerfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00072c8c..04624c0f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,6 +32,7 @@ jobs: - "8.0" - "8.1" - "8.2" + - "8.3" compiler: - default @@ -46,7 +47,9 @@ jobs: - os: ubuntu-latest php-version: "8.2" compiler: jit - + - os: ubuntu-latest + php-version: "8.3" + compiler: jit steps: - name: Checkout uses: actions/checkout@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 04be00ec..d08653d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added +- PHP8.3 support [#925](https://github.com/smarty-php/smarty/issues/925) + ## [4.3.4] - 2023-09-14 ## [4.3.3] - 2023-09-14 diff --git a/docker-compose.yml b/docker-compose.yml index 4f940b2c..ff759f5f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -42,3 +42,8 @@ services: service: base build: dockerfile: ./utilities/testrunners/php82/Dockerfile + php83: + extends: + service: base + build: + dockerfile: ./utilities/testrunners/php83/Dockerfile \ No newline at end of file diff --git a/libs/sysplugins/smarty_internal_errorhandler.php b/libs/sysplugins/smarty_internal_errorhandler.php index 6f526c38..4ddcfcd1 100644 --- a/libs/sysplugins/smarty_internal_errorhandler.php +++ b/libs/sysplugins/smarty_internal_errorhandler.php @@ -94,7 +94,7 @@ class Smarty_Internal_ErrorHandler } if ($this->allowUndefinedArrayKeys && preg_match( - '/^(Undefined index|Undefined array key|Trying to access array offset on value of type)/', + '/^(Undefined index|Undefined array key|Trying to access array offset on)/', $errstr )) { return; // suppresses this error diff --git a/run-tests-for-all-php-versions.sh b/run-tests-for-all-php-versions.sh index b64f01e4..79bebb8a 100755 --- a/run-tests-for-all-php-versions.sh +++ b/run-tests-for-all-php-versions.sh @@ -10,4 +10,6 @@ docker-compose run php72 ./run-tests.sh $@ && \ docker-compose run php73 ./run-tests.sh $@ && \ docker-compose run php74 ./run-tests.sh $@ && \ docker-compose run php80 ./run-tests.sh $@ && \ -docker-compose run php81 ./run-tests.sh $@ +docker-compose run php81 ./run-tests.sh $@ && \ +docker-compose run php82 ./run-tests.sh $@ && \ +docker-compose run php83 ./run-tests.sh $@ diff --git a/utilities/testrunners/php83/Dockerfile b/utilities/testrunners/php83/Dockerfile new file mode 100644 index 00000000..83cd8255 --- /dev/null +++ b/utilities/testrunners/php83/Dockerfile @@ -0,0 +1,10 @@ +FROM php:8.3-cli + +## Basic utilities +RUN apt-get update -yqq && apt-get install -y curl apt-utils git zip unzip + +## Composer +COPY ./utilities/testrunners/shared/install-composer.sh /root/install-composer.sh +WORKDIR /root +RUN sh ./install-composer.sh +RUN mv ./composer.phar /usr/local/bin/composer