Skip to content

Commit 011a169

Browse files
committed
feat(php): add support for php 7.4~8.x
1 parent 9dc991e commit 011a169

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
ARG PHP_RUNTIME=8.1
2+
13
FROM php:8.1-cli AS builder
24
WORKDIR /src
35
RUN apt-get update && apt-get install -y unzip git jq \
@@ -12,7 +14,7 @@ RUN composer install --no-dev --optimize-autoloader && \
1214
mkdir -p /build_out && \
1315
composer archive --format=tar --dir=/build_out
1416

15-
FROM php:8.1-cli
17+
FROM php:${PHP_RUNTIME}-cli
1618
WORKDIR /app
1719
RUN apt-get update && apt-get install -y unzip git libzip-dev \
1820
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

Makefile

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,19 @@ reconnect-test: build
4646
-e API_PASSPHRASE="$$API_PASSPHRASE" \
4747
--name php-reconnect-test --network isolated_net \
4848
php-sdk-image:latest \
49-
bash /app/ws_reconnect_test.sh
49+
bash /app/ws_reconnect_test.sh
50+
51+
52+
VERSIONS = 7.4 8.0 8.1 8.2
53+
.PHONY: php-version-test
54+
php-version-test:
55+
@for v in $(VERSIONS); do \
56+
echo "---- PHP $$v ----"; \
57+
docker build --build-arg PHP_RUNTIME=$$v -t php-sdk-image:$$v . ; \
58+
docker run --rm \
59+
-e API_KEY="$$API_KEY" \
60+
-e API_SECRET="$$API_SECRET" \
61+
-e API_PASSPHRASE="$$API_PASSPHRASE" \
62+
-e USE_LOCAL="true" \
63+
php-sdk-image:$$v bash /app/release_test.sh || exit $$? ; \
64+
done

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
}
2424
],
2525
"require": {
26-
"php": ">=7.4",
26+
"php": "^7.4 || ^8.0",
2727
"jms/serializer": "^3.32",
2828
"doctrine/annotations": "^2.0",
2929
"guzzlehttp/guzzle": "^7.9",

script/release_test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ else
2525
composer require kucoin/kucoin-universal-sdk
2626
fi
2727

28-
cat composer.json
28+
echo "Echo depends..."
29+
composer depends php
2930

3031
echo "Running service scripts..."
3132
cp /src/tests/regression/RunServiceTest.php /app

0 commit comments

Comments
 (0)