Skip to content

Add PHP 8 #1132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 44 commits into from
Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
3f82f63
Add PHP 8 to the build matrix for unit tests
andrewmy Jan 25, 2021
518742c
Allow php8 in all composer.json files
andrewmy Jan 25, 2021
f63631b
Update doctrine/dbal to 2.12
andrewmy Jan 25, 2021
c464121
Update php-http/client-common to 2.2.1
andrewmy Jan 25, 2021
aafad21
Try a fork of richardfullmer/rabbitmq-management-api
andrewmy Jan 25, 2021
d1cec94
Derp
andrewmy Jan 25, 2021
46501f6
Replace guzzle6 with 7
andrewmy Jan 25, 2021
dd3ffe0
Remove referencing non-existent property
andrewmy Jan 25, 2021
fc9d492
Try a fork of doctrine/mongodb-odm-bundle
andrewmy Jan 25, 2021
03c31d1
Try allowing an older version of odm bundle too
andrewmy Jan 25, 2021
7c805fd
Nope
andrewmy Jan 25, 2021
b23e733
Run stan and cs-fixer with sf 5.2; add php 7.4 + sf 5.2 unit test job
andrewmy Jan 25, 2021
928f0e8
Fix exception message variations between versions
andrewmy Jan 25, 2021
163a6f0
Derp
andrewmy Jan 25, 2021
5ac76b2
Derp
andrewmy Jan 25, 2021
35a84ed
🤔
andrewmy Jan 25, 2021
ab8f784
Ok got the regex
andrewmy Jan 25, 2021
c73d475
Try building php 8 container
andrewmy Jan 25, 2021
86411e4
Fix the default version parameter
andrewmy Jan 25, 2021
2de3638
Pull silently
andrewmy Jan 25, 2021
c90b6b8
Stringify the php version arg
andrewmy Jan 25, 2021
44f2841
Now it started installing 8 and 7 libs together
andrewmy Jan 25, 2021
06df4e0
Pear is not versioned
andrewmy Jan 25, 2021
8049c47
Update the docker hub namespace
andrewmy Jan 25, 2021
1942765
Stringify the php version arg
andrewmy Jan 25, 2021
4423c45
CI: better composer install step
andrewmy Jan 25, 2021
023ff01
Try a fork of stomp-php/stomp-php
andrewmy Jan 26, 2021
e0f1c2f
Fix ext-gearman install
andrewmy Jan 26, 2021
a1eb22f
Derp
andrewmy Jan 26, 2021
36ed6ac
Move pear around
andrewmy Jan 26, 2021
a08df5c
Move make around
andrewmy Jan 26, 2021
a26cdf5
doctrine/mongodb-odm-bundle 4.3 released 🎉
andrewmy Feb 2, 2021
54fee9e
stomp-php/stomp-php 5.0 released 🎉
andrewmy Feb 3, 2021
86684ff
Use the proper tagged base docker image
andrewmy Feb 9, 2021
073bcba
XML extension not found?
andrewmy Feb 9, 2021
a98f7e7
MySQL driver not found 🤦‍♂️
andrewmy Feb 9, 2021
4f8e1ca
Gearman already installed
andrewmy Feb 9, 2021
ddf1146
Revert "Gearman already installed"
andrewmy Feb 9, 2021
480eef5
Fix gearman?
andrewmy Feb 9, 2021
f67ec8a
Fix curl, conditionally install gearman
andrewmy Feb 9, 2021
684cc26
Fix 7.3 gearman
andrewmy Feb 9, 2021
0257a50
Add php 8 to packages' build matrices; normalize composer reqs
andrewmy Feb 9, 2021
f093ee2
Use the release from the fork
andrewmy Feb 16, 2021
41bbfbd
Add the fork repo to the split package
andrewmy Feb 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
extensions: mongodb, redis, :xdebug
ini-values: memory_limit=2048M

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

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

Expand All @@ -50,7 +50,7 @@ jobs:
extensions: mongodb, redis, :xdebug
ini-values: memory_limit=2048M

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

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

Expand Down Expand Up @@ -102,6 +102,12 @@ jobs:
functional_tests: false
rdkafka_tests: false
prepare_container: false
- php: 7.4
symfony_version: 5.2.*
unit_tests: true
functional_tests: false
rdkafka_tests: false
prepare_container: false
- php: 7.3 # same as in the container
symfony_version: 4.3.*
unit_tests: false
Expand All @@ -120,6 +126,23 @@ jobs:
functional_tests: false
rdkafka_tests: true
prepare_container: true
- php: "8.0"
symfony_version: 5.2.*
unit_tests: true
functional_tests: false
rdkafka_tests: false
prepare_container: false
- php: "8.0"
symfony_version: 5.2.*
unit_tests: false
functional_tests: true
rdkafka_tests: false
prepare_container: true
- php: "8.0"
symfony_version: 5.2.*
unit_tests: false
rdkafka_tests: true
prepare_container: true

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

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

- run: bin/dev -b
env:
PHP_VERSION: "${{ matrix.php }}"
if: matrix.prepare_container

- run: bin/phpunit --exclude-group=functional
Expand Down
2 changes: 1 addition & 1 deletion bin/dev
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -e
while getopts "bustefdp" OPTION; do
case $OPTION in
b)
docker-compose pull && docker-compose build
docker-compose pull -q && docker-compose build
;;
u)
docker-compose up
Expand Down
20 changes: 13 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@
"cs-lint": "bin/php-cs-fixer fix --config=.php_cs.php --no-interaction --dry-run --diff",
"phpstan": "bin/phpstan analyse --memory-limit=512M -c phpstan.neon"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/andrewmy/php-rabbitmq-management-api.git"
}
],
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",

"ext-amqp": "^1.9.3",
"ext-gearman": "^2.0",
Expand All @@ -20,7 +26,7 @@
"queue-interop/queue-interop": "^0.7|^0.8",
"bunny/bunny": "^0.2.4|^0.3|^0.4",
"php-amqplib/php-amqplib": "^2.7",
"doctrine/dbal": "^2.6,<2.10",
"doctrine/dbal": "^2.12",
"ramsey/uuid": "^2|^3.5|^4.0",
"psr/log": "^1",
"psr/container": "^1",
Expand All @@ -30,10 +36,10 @@
"mongodb/mongodb": "^1.2",
"pda/pheanstalk": "^3",
"aws/aws-sdk-php": "^3.26",
"stomp-php/stomp-php": "^4",
"php-http/guzzle6-adapter": "^1.1",
"php-http/client-common": "^1.7@dev",
"richardfullmer/rabbitmq-management-api": "^2.0",
"stomp-php/stomp-php": "^4|^5",
"php-http/guzzle7-adapter": "^0.1.1",
"php-http/client-common": "^2.2.1",
"richardfullmer/rabbitmq-management-api": "^2.1.1",
"predis/predis": "^1.1",
"thruway/client": "^0.5.0",
"thruway/pawl-transport": "^0.5.0",
Expand All @@ -58,7 +64,7 @@
"symfony/yaml": "^4.3|^5",
"empi89/php-amqp-stubs": "*@dev",
"doctrine/doctrine-bundle": "~1.2|^2",
"doctrine/mongodb-odm-bundle": "^3.5|^4",
"doctrine/mongodb-odm-bundle": "^3.5|^4.3",
"alcaeus/mongo-php-adapter": "^1.0",
"kwn/php-rdkafka-stubs": "^1.0.2 | ^2.0",
"friendsofphp/php-cs-fixer": "^2",
Expand Down
7 changes: 6 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ version: '2'

services:
dev:
image: enqueue/dev:latest
# when image publishing gets sorted:
# image: enqueue/dev:${PHP_VERSION}
build:
context: docker
args:
PHP_VERSION: "${PHP_VERSION:-7.3}"
depends_on:
- rabbitmq
- mysql
Expand Down
43 changes: 37 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,55 @@
FROM formapro/nginx-php-fpm:7.3-latest-all-exts
ARG PHP_VERSION=7.3
FROM makasim/nginx-php-fpm:${PHP_VERSION}-all-exts

ARG PHP_VERSION

## libs
RUN set -x && \
apt-get update && \
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
apt-get install -y --no-install-recommends --no-install-suggests \
wget \
curl \
openssl \
ca-certificates \
nano \
netcat \
php${PHP_VERSION}-dev \
php${PHP_VERSION}-redis \
php${PHP_VERSION}-pgsql \
git \
python \
php${PHP_VERSION}-amqp \
php${PHP_VERSION}-xml \
php${PHP_VERSION}-mysql \
php${PHP_VERSION}-curl \
libgearman-dev \
php-pear \
make \
&& \
pecl channel-update pecl.php.net && \
pecl install gearman && \
if [ ! -f /etc/php/${PHP_VERSION}/cli/conf.d/20-gearman.ini ]; then \
echo "extension=gearman.so" > /etc/php/${PHP_VERSION}/cli/conf.d/20-gearman.ini && \
echo "extension=gearman.so" > /etc/php/${PHP_VERSION}/fpm/conf.d/20-gearman.ini \
; \
fi;

## librdkafka
RUN set -x && \
apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests g++ php-pear php7.3-dev make && \
apt-get install -y --no-install-recommends --no-install-suggests \
g++ \
&& \
mkdir -p $HOME/librdkafka && \
cd $HOME/librdkafka && \
git clone https://github.com/edenhill/librdkafka.git . && \
git checkout v1.0.0 && \
./configure && make && make install && \
pecl install rdkafka && \
echo "extension=rdkafka.so" > /etc/php/7.3/cli/conf.d/10-rdkafka.ini && \
echo "extension=rdkafka.so" > /etc/php/7.3/fpm/conf.d/10-rdkafka.ini
echo "extension=rdkafka.so" > /etc/php/${PHP_VERSION}/cli/conf.d/10-rdkafka.ini && \
echo "extension=rdkafka.so" > /etc/php/${PHP_VERSION}/fpm/conf.d/10-rdkafka.ini

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

Expand Down
2 changes: 1 addition & 1 deletion docker/thruway/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM formapro/nginx-php-fpm:latest-all-exts
FROM makasim/nginx-php-fpm:latest-all-exts

RUN mkdir -p /thruway
WORKDIR /thruway
Expand Down
2 changes: 1 addition & 1 deletion pkg/amqp-bunny/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.3', '7.4']
php: ['7.3', '7.4', '8.0']

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

Expand Down
2 changes: 1 addition & 1 deletion pkg/amqp-bunny/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"queue-interop/amqp-interop": "^0.8",
"queue-interop/queue-interop": "^0.8",
"bunny/bunny": "^0.4",
Expand Down
2 changes: 1 addition & 1 deletion pkg/amqp-ext/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.3', '7.4']
php: ['7.3', '7.4', '8.0']

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

Expand Down
2 changes: 1 addition & 1 deletion pkg/amqp-ext/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"ext-amqp": "^1.9.3",
"queue-interop/amqp-interop": "^0.8",
"queue-interop/queue-interop": "^0.8",
Expand Down
2 changes: 1 addition & 1 deletion pkg/amqp-lib/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.3', '7.4']
php: ['7.3', '7.4', '8.0']

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

Expand Down
2 changes: 1 addition & 1 deletion pkg/amqp-lib/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"php-amqplib/php-amqplib": "^2.10",
"queue-interop/amqp-interop": "^0.8",
"queue-interop/queue-interop": "^0.8",
Expand Down
2 changes: 1 addition & 1 deletion pkg/amqp-tools/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.3', '7.4']
php: ['7.3', '7.4', '8.0']

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

Expand Down
2 changes: 1 addition & 1 deletion pkg/amqp-tools/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"queue-interop/amqp-interop": "^0.8",
"queue-interop/queue-interop": "^0.8",
"enqueue/dsn": "^0.10"
Expand Down
2 changes: 1 addition & 1 deletion pkg/async-command/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.3', '7.4']
php: ['7.3', '7.4', '8.0']

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

Expand Down
2 changes: 1 addition & 1 deletion pkg/async-command/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": ">=7.1",
"php": "^7.3|^8.0",
"enqueue/enqueue": "^0.10",
"queue-interop/queue-interop": "^0.8",
"symfony/console": "^4.3|^5",
Expand Down
2 changes: 1 addition & 1 deletion pkg/async-event-dispatcher/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.3', '7.4']
php: ['7.3', '7.4', '8.0']

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

Expand Down
2 changes: 1 addition & 1 deletion pkg/async-event-dispatcher/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"enqueue/enqueue": "^0.10",
"queue-interop/queue-interop": "^0.8",
"symfony/event-dispatcher": "^4.3|^5"
Expand Down
2 changes: 1 addition & 1 deletion pkg/dbal/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.3', '7.4']
php: ['7.3', '7.4', '8.0']

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

Expand Down
4 changes: 2 additions & 2 deletions pkg/dbal/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"queue-interop/queue-interop": "^0.8",
"doctrine/dbal": "^2.6",
"doctrine/dbal": "^2.12",
"ramsey/uuid": "^3|^4"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion pkg/dsn/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.3', '7.4']
php: ['7.3', '7.4', '8.0']

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

Expand Down
4 changes: 2 additions & 2 deletions pkg/dsn/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.1.3"
"php": "^7.3|^8.0"
},
"require-dev": {
"phpunit/phpunit": "~7.5"
"phpunit/phpunit": "^9.5"
},
"support": {
"email": "[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion pkg/enqueue-bundle/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.3', '7.4']
php: ['7.3', '7.4', '8.0']

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ public function testThrowIfClientDriverOptionsIsNotArray()
$processor = new Processor();

$this->expectException(InvalidTypeException::class);
$this->expectExceptionMessage('Invalid type for path "enqueue.default.client.driver_options". Expected array, but got string');
// Exception messages vary slightly between versions
$this->expectExceptionMessageMatches(
'/Invalid type for path "enqueue\.default\.client\.driver_options"\. Expected "?array"?, but got "?string"?/'
);

$processor->processConfiguration($configuration, [[
'default' => [
'transport' => 'null:',
Expand Down
4 changes: 2 additions & 2 deletions pkg/enqueue-bundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://enqueue.forma-pro.com/",
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"symfony/framework-bundle": "^4.3|^5",
"queue-interop/amqp-interop": "^0.8",
"queue-interop/queue-interop": "^0.8",
Expand Down Expand Up @@ -37,7 +37,7 @@
"enqueue/async-command": "0.10.x-dev",
"php-amqplib/php-amqplib": "^2.7",
"doctrine/doctrine-bundle": "~1.2|^2",
"doctrine/mongodb-odm-bundle": "^3.5|^4",
"doctrine/mongodb-odm-bundle": "^3.5|^4.3",
"alcaeus/mongo-php-adapter": "^1.0",
"symfony/browser-kit": "^4.3|^5",
"symfony/expression-language": "^4.3|^5",
Expand Down
Loading