Skip to content

Commit 18e9444

Browse files
authored
Merge pull request #1132 from andrewmy/add-php-8-2
Add PHP 8
2 parents cb7a555 + 41bbfbd commit 18e9444

File tree

61 files changed

+161
-97
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+161
-97
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
extensions: mongodb, redis, :xdebug
2424
ini-values: memory_limit=2048M
2525

26-
- run: php ./bin/fix-symfony-version.php "4.3.*"
26+
- run: php ./bin/fix-symfony-version.php "5.2.*"
2727

2828
- uses: "ramsey/composer-install@v1"
2929

@@ -50,7 +50,7 @@ jobs:
5050
extensions: mongodb, redis, :xdebug
5151
ini-values: memory_limit=2048M
5252

53-
- run: php ./bin/fix-symfony-version.php "4.3.*"
53+
- run: php ./bin/fix-symfony-version.php "5.2.*"
5454

5555
- uses: "ramsey/composer-install@v1"
5656

@@ -102,6 +102,12 @@ jobs:
102102
functional_tests: false
103103
rdkafka_tests: false
104104
prepare_container: false
105+
- php: 7.4
106+
symfony_version: 5.2.*
107+
unit_tests: true
108+
functional_tests: false
109+
rdkafka_tests: false
110+
prepare_container: false
105111
- php: 7.3 # same as in the container
106112
symfony_version: 4.3.*
107113
unit_tests: false
@@ -120,6 +126,23 @@ jobs:
120126
functional_tests: false
121127
rdkafka_tests: true
122128
prepare_container: true
129+
- php: "8.0"
130+
symfony_version: 5.2.*
131+
unit_tests: true
132+
functional_tests: false
133+
rdkafka_tests: false
134+
prepare_container: false
135+
- php: "8.0"
136+
symfony_version: 5.2.*
137+
unit_tests: false
138+
functional_tests: true
139+
rdkafka_tests: false
140+
prepare_container: true
141+
- php: "8.0"
142+
symfony_version: 5.2.*
143+
unit_tests: false
144+
rdkafka_tests: true
145+
prepare_container: true
123146

124147
name: PHP ${{ matrix.php }} tests on Sf ${{ matrix.symfony_version }}, unit=${{ matrix.unit_tests }}, func=${{ matrix.functional_tests }}, rdkafka=${{ matrix.rdkafka_tests }}
125148

@@ -140,6 +163,8 @@ jobs:
140163
- run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php
141164

142165
- run: bin/dev -b
166+
env:
167+
PHP_VERSION: "${{ matrix.php }}"
143168
if: matrix.prepare_container
144169

145170
- run: bin/phpunit --exclude-group=functional

bin/dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -e
66
while getopts "bustefdp" OPTION; do
77
case $OPTION in
88
b)
9-
docker-compose pull && docker-compose build
9+
docker-compose pull -q && docker-compose build
1010
;;
1111
u)
1212
docker-compose up

composer.json

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@
88
"cs-lint": "bin/php-cs-fixer fix --config=.php_cs.php --no-interaction --dry-run --diff",
99
"phpstan": "bin/phpstan analyse --memory-limit=512M -c phpstan.neon"
1010
},
11+
"repositories": [
12+
{
13+
"type": "git",
14+
"url": "https://github.com/andrewmy/php-rabbitmq-management-api.git"
15+
}
16+
],
1117
"require": {
12-
"php": "^7.3",
18+
"php": "^7.3|^8.0",
1319

1420
"ext-amqp": "^1.9.3",
1521
"ext-gearman": "^2.0",
@@ -20,7 +26,7 @@
2026
"queue-interop/queue-interop": "^0.7|^0.8",
2127
"bunny/bunny": "^0.2.4|^0.3|^0.4",
2228
"php-amqplib/php-amqplib": "^2.7",
23-
"doctrine/dbal": "^2.6,<2.10",
29+
"doctrine/dbal": "^2.12",
2430
"ramsey/uuid": "^2|^3.5|^4.0",
2531
"psr/log": "^1",
2632
"psr/container": "^1",
@@ -30,10 +36,10 @@
3036
"mongodb/mongodb": "^1.2",
3137
"pda/pheanstalk": "^3",
3238
"aws/aws-sdk-php": "^3.26",
33-
"stomp-php/stomp-php": "^4",
34-
"php-http/guzzle6-adapter": "^1.1",
35-
"php-http/client-common": "^1.7@dev",
36-
"richardfullmer/rabbitmq-management-api": "^2.0",
39+
"stomp-php/stomp-php": "^4|^5",
40+
"php-http/guzzle7-adapter": "^0.1.1",
41+
"php-http/client-common": "^2.2.1",
42+
"richardfullmer/rabbitmq-management-api": "^2.1.1",
3743
"predis/predis": "^1.1",
3844
"thruway/client": "^0.5.0",
3945
"thruway/pawl-transport": "^0.5.0",
@@ -58,7 +64,7 @@
5864
"symfony/yaml": "^4.3|^5",
5965
"empi89/php-amqp-stubs": "*@dev",
6066
"doctrine/doctrine-bundle": "~1.2|^2",
61-
"doctrine/mongodb-odm-bundle": "^3.5|^4",
67+
"doctrine/mongodb-odm-bundle": "^3.5|^4.3",
6268
"alcaeus/mongo-php-adapter": "^1.0",
6369
"kwn/php-rdkafka-stubs": "^1.0.2 | ^2.0",
6470
"friendsofphp/php-cs-fixer": "^2",

docker-compose.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ version: '2'
22

33
services:
44
dev:
5-
image: enqueue/dev:latest
5+
# when image publishing gets sorted:
6+
# image: enqueue/dev:${PHP_VERSION}
7+
build:
8+
context: docker
9+
args:
10+
PHP_VERSION: "${PHP_VERSION:-7.3}"
611
depends_on:
712
- rabbitmq
813
- mysql

docker/Dockerfile

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,55 @@
1-
FROM formapro/nginx-php-fpm:7.3-latest-all-exts
1+
ARG PHP_VERSION=7.3
2+
FROM makasim/nginx-php-fpm:${PHP_VERSION}-all-exts
3+
4+
ARG PHP_VERSION
25

36
## libs
47
RUN set -x && \
58
apt-get update && \
6-
apt-get install -y --no-install-recommends --no-install-suggests wget curl openssl ca-certificates nano netcat php7.3-dev php7.3-redis php7.3-pgsql git python php-amqp
9+
apt-get install -y --no-install-recommends --no-install-suggests \
10+
wget \
11+
curl \
12+
openssl \
13+
ca-certificates \
14+
nano \
15+
netcat \
16+
php${PHP_VERSION}-dev \
17+
php${PHP_VERSION}-redis \
18+
php${PHP_VERSION}-pgsql \
19+
git \
20+
python \
21+
php${PHP_VERSION}-amqp \
22+
php${PHP_VERSION}-xml \
23+
php${PHP_VERSION}-mysql \
24+
php${PHP_VERSION}-curl \
25+
libgearman-dev \
26+
php-pear \
27+
make \
28+
&& \
29+
pecl channel-update pecl.php.net && \
30+
pecl install gearman && \
31+
if [ ! -f /etc/php/${PHP_VERSION}/cli/conf.d/20-gearman.ini ]; then \
32+
echo "extension=gearman.so" > /etc/php/${PHP_VERSION}/cli/conf.d/20-gearman.ini && \
33+
echo "extension=gearman.so" > /etc/php/${PHP_VERSION}/fpm/conf.d/20-gearman.ini \
34+
; \
35+
fi;
736

837
## librdkafka
938
RUN set -x && \
1039
apt-get update && \
11-
apt-get install -y --no-install-recommends --no-install-suggests g++ php-pear php7.3-dev make && \
40+
apt-get install -y --no-install-recommends --no-install-suggests \
41+
g++ \
42+
&& \
1243
mkdir -p $HOME/librdkafka && \
1344
cd $HOME/librdkafka && \
1445
git clone https://github.com/edenhill/librdkafka.git . && \
1546
git checkout v1.0.0 && \
1647
./configure && make && make install && \
1748
pecl install rdkafka && \
18-
echo "extension=rdkafka.so" > /etc/php/7.3/cli/conf.d/10-rdkafka.ini && \
19-
echo "extension=rdkafka.so" > /etc/php/7.3/fpm/conf.d/10-rdkafka.ini
49+
echo "extension=rdkafka.so" > /etc/php/${PHP_VERSION}/cli/conf.d/10-rdkafka.ini && \
50+
echo "extension=rdkafka.so" > /etc/php/${PHP_VERSION}/fpm/conf.d/10-rdkafka.ini
2051

21-
COPY ./php/cli.ini /etc/php/7.3/cli/conf.d/1-dev_cli.ini
52+
COPY ./php/cli.ini /etc/php/${PHP_VERSION}/cli/conf.d/1-dev_cli.ini
2253
COPY ./bin/dev_entrypoiny.sh /usr/local/bin/entrypoint.sh
2354
RUN chmod u+x /usr/local/bin/entrypoint.sh
2455

docker/thruway/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM formapro/nginx-php-fpm:latest-all-exts
1+
FROM makasim/nginx-php-fpm:latest-all-exts
22

33
RUN mkdir -p /thruway
44
WORKDIR /thruway

pkg/amqp-bunny/.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
php: ['7.3', '7.4']
13+
php: ['7.3', '7.4', '8.0']
1414

1515
name: PHP ${{ matrix.php }} tests
1616

pkg/amqp-bunny/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"homepage": "https://enqueue.forma-pro.com/",
77
"license": "MIT",
88
"require": {
9-
"php": "^7.3",
9+
"php": "^7.3|^8.0",
1010
"queue-interop/amqp-interop": "^0.8",
1111
"queue-interop/queue-interop": "^0.8",
1212
"bunny/bunny": "^0.4",

pkg/amqp-ext/.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
php: ['7.3', '7.4']
13+
php: ['7.3', '7.4', '8.0']
1414

1515
name: PHP ${{ matrix.php }} tests
1616

pkg/amqp-ext/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"homepage": "https://enqueue.forma-pro.com/",
77
"license": "MIT",
88
"require": {
9-
"php": "^7.3",
9+
"php": "^7.3|^8.0",
1010
"ext-amqp": "^1.9.3",
1111
"queue-interop/amqp-interop": "^0.8",
1212
"queue-interop/queue-interop": "^0.8",

pkg/amqp-lib/.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
php: ['7.3', '7.4']
13+
php: ['7.3', '7.4', '8.0']
1414

1515
name: PHP ${{ matrix.php }} tests
1616

pkg/amqp-lib/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"homepage": "https://enqueue.forma-pro.com/",
77
"license": "MIT",
88
"require": {
9-
"php": "^7.3",
9+
"php": "^7.3|^8.0",
1010
"php-amqplib/php-amqplib": "^2.10",
1111
"queue-interop/amqp-interop": "^0.8",
1212
"queue-interop/queue-interop": "^0.8",

pkg/amqp-tools/.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
php: ['7.3', '7.4']
13+
php: ['7.3', '7.4', '8.0']
1414

1515
name: PHP ${{ matrix.php }} tests
1616

pkg/amqp-tools/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"homepage": "https://enqueue.forma-pro.com/",
77
"license": "MIT",
88
"require": {
9-
"php": "^7.3",
9+
"php": "^7.3|^8.0",
1010
"queue-interop/amqp-interop": "^0.8",
1111
"queue-interop/queue-interop": "^0.8",
1212
"enqueue/dsn": "^0.10"

pkg/async-command/.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
php: ['7.3', '7.4']
13+
php: ['7.3', '7.4', '8.0']
1414

1515
name: PHP ${{ matrix.php }} tests
1616

pkg/async-command/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"homepage": "https://enqueue.forma-pro.com/",
77
"license": "MIT",
88
"require": {
9-
"php": ">=7.1",
9+
"php": "^7.3|^8.0",
1010
"enqueue/enqueue": "^0.10",
1111
"queue-interop/queue-interop": "^0.8",
1212
"symfony/console": "^4.3|^5",

pkg/async-event-dispatcher/.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
php: ['7.3', '7.4']
13+
php: ['7.3', '7.4', '8.0']
1414

1515
name: PHP ${{ matrix.php }} tests
1616

pkg/async-event-dispatcher/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"homepage": "https://enqueue.forma-pro.com/",
77
"license": "MIT",
88
"require": {
9-
"php": "^7.3",
9+
"php": "^7.3|^8.0",
1010
"enqueue/enqueue": "^0.10",
1111
"queue-interop/queue-interop": "^0.8",
1212
"symfony/event-dispatcher": "^4.3|^5"

pkg/dbal/.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
php: ['7.3', '7.4']
13+
php: ['7.3', '7.4', '8.0']
1414

1515
name: PHP ${{ matrix.php }} tests
1616

pkg/dbal/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"homepage": "https://enqueue.forma-pro.com/",
77
"license": "MIT",
88
"require": {
9-
"php": "^7.3",
9+
"php": "^7.3|^8.0",
1010
"queue-interop/queue-interop": "^0.8",
11-
"doctrine/dbal": "^2.6",
11+
"doctrine/dbal": "^2.12",
1212
"ramsey/uuid": "^3|^4"
1313
},
1414
"require-dev": {

pkg/dsn/.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
php: ['7.3', '7.4']
13+
php: ['7.3', '7.4', '8.0']
1414

1515
name: PHP ${{ matrix.php }} tests
1616

pkg/dsn/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"homepage": "https://enqueue.forma-pro.com/",
77
"license": "MIT",
88
"require": {
9-
"php": "^7.1.3"
9+
"php": "^7.3|^8.0"
1010
},
1111
"require-dev": {
12-
"phpunit/phpunit": "~7.5"
12+
"phpunit/phpunit": "^9.5"
1313
},
1414
"support": {
1515
"email": "opensource@forma-pro.com",

pkg/enqueue-bundle/.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
php: ['7.3', '7.4']
13+
php: ['7.3', '7.4', '8.0']
1414

1515
name: PHP ${{ matrix.php }} tests
1616

pkg/enqueue-bundle/Tests/Unit/DependencyInjection/ConfigurationTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,11 @@ public function testThrowIfClientDriverOptionsIsNotArray()
113113
$processor = new Processor();
114114

115115
$this->expectException(InvalidTypeException::class);
116-
$this->expectExceptionMessage('Invalid type for path "enqueue.default.client.driver_options". Expected array, but got string');
116+
// Exception messages vary slightly between versions
117+
$this->expectExceptionMessageMatches(
118+
'/Invalid type for path "enqueue\.default\.client\.driver_options"\. Expected "?array"?, but got "?string"?/'
119+
);
120+
117121
$processor->processConfiguration($configuration, [[
118122
'default' => [
119123
'transport' => 'null:',

pkg/enqueue-bundle/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"homepage": "https://enqueue.forma-pro.com/",
77
"license": "MIT",
88
"require": {
9-
"php": "^7.3",
9+
"php": "^7.3|^8.0",
1010
"symfony/framework-bundle": "^4.3|^5",
1111
"queue-interop/amqp-interop": "^0.8",
1212
"queue-interop/queue-interop": "^0.8",
@@ -37,7 +37,7 @@
3737
"enqueue/async-command": "0.10.x-dev",
3838
"php-amqplib/php-amqplib": "^2.7",
3939
"doctrine/doctrine-bundle": "~1.2|^2",
40-
"doctrine/mongodb-odm-bundle": "^3.5|^4",
40+
"doctrine/mongodb-odm-bundle": "^3.5|^4.3",
4141
"alcaeus/mongo-php-adapter": "^1.0",
4242
"symfony/browser-kit": "^4.3|^5",
4343
"symfony/expression-language": "^4.3|^5",

0 commit comments

Comments
 (0)