From f509da189ed5d9479c4d1d55af80b9c5ab9557ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Wed, 1 Jul 2020 15:19:21 +0200 Subject: [PATCH 01/36] Install from source to actually run any tests (excluded otherwise) --- composer.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/composer.json b/composer.json index 90586b7f..712959c1 100644 --- a/composer.json +++ b/composer.json @@ -21,5 +21,10 @@ "phpunit/phpunit": "^5.7 || ^4.8.35", "clue/block-react": "^1.1", "clue/stream-filter": "^1.3" + }, + "config": { + "preferred-install": { + "react/*": "source" + } } } From 57ac1c9bd4d0cd7dd703f9dc02a8a7b6232148d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sun, 22 Mar 2020 15:04:27 +0100 Subject: [PATCH 02/36] Upgrade react/socket to avoid skipping DNS tests Refs https://github.com/reactphp/socket/pull/208 --- composer.json | 4 ++-- phpunit.xml.dist | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 712959c1..d4f7e176 100644 --- a/composer.json +++ b/composer.json @@ -10,11 +10,11 @@ "require": { "php": ">=5.3.8", "react/cache": "^1.0", - "react/dns": "^1.0", + "react/dns": "^1.1", "react/event-loop": "^1.0", "react/promise": "^2.1 || ^1.2", "react/promise-stream": "^1.1.1", - "react/socket": "^1.0", + "react/socket": "^1.4", "react/stream": "^1.0" }, "require-dev": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 4954d676..d7f645a3 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -14,9 +14,6 @@ ./vendor/react/*/tests/ - - ./vendor/react/socket/tests/ConnectorTest.php - ./vendor/react/socket/tests/DnsConnectorTest.php From 52f330eaab056b61ed86ea81fb37ce33588e0174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Fri, 10 Jul 2020 17:36:44 +0200 Subject: [PATCH 03/36] Run tests on PHP 7.4 and simplify test matrix Refs https://github.com/reactphp/dns/pull/156 and https://github.com/reactphp/promise-timer/pull/41 --- .travis.yml | 21 ++++++++++----------- composer.json | 7 ++++--- phpunit.xml.dist | 14 ++------------ 3 files changed, 16 insertions(+), 26 deletions(-) diff --git a/.travis.yml b/.travis.yml index 79683903..bc648517 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,5 @@ language: php -php: -# - 5.3 # requires old distro, see below - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - hhvm - # lock distro so new future defaults will not break the build dist: trusty @@ -17,8 +7,17 @@ matrix: include: - php: 5.3 dist: precise + - php: 5.4 + - php: 5.5 + - php: 5.6 + - php: 7.0 + - php: 7.1 + - php: 7.2 + - php: 7.3 + - php: 7.4 + - php: hhvm-3.18 allow_failures: - - php: hhvm + - php: hhvm-3.18 install: - composer install --no-interaction diff --git a/composer.json b/composer.json index d4f7e176..b56807fc 100644 --- a/composer.json +++ b/composer.json @@ -10,17 +10,18 @@ "require": { "php": ">=5.3.8", "react/cache": "^1.0", - "react/dns": "^1.1", + "react/dns": "^1.3", "react/event-loop": "^1.0", "react/promise": "^2.1 || ^1.2", "react/promise-stream": "^1.1.1", + "react/promise-timer": "^1.6", "react/socket": "^1.4", "react/stream": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^4.8.35", "clue/block-react": "^1.1", - "clue/stream-filter": "^1.3" + "clue/stream-filter": "^1.3", + "phpunit/phpunit": "^7.0 || ^6.0 || ^5.7 || ^4.8.35" }, "config": { "preferred-install": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d7f645a3..1cf2f8a6 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,18 +1,8 @@ - + - + ./vendor/react/*/tests/ From 40d469f311bae28243be9d1c925b869d31160a9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Fri, 10 Jul 2020 18:15:03 +0200 Subject: [PATCH 04/36] Skip affected test cases to avoid bogus test failure on PHP 7.4 The build error on PHP 7.4 will be addressed via https://github.com/reactphp/dns/pull/164. Interestingly, it fails in the `FunctionalResolverTest` class and does not fail anymore by excluding some other test cases. It can only be reproduced by running: ``` $ vendor/bin/phpunit --coverage-text --exclude-group internet ``` It can not be reproduced when running on any other PHP version, when `ext-xdebug` is disabled, when coverage is not collected or when not excluding this group. This means the test failure is bogus. We work around this by temporarily skipping some test case for now. --- phpunit.xml.dist | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 1cf2f8a6..4dc40d79 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -4,6 +4,10 @@ ./vendor/react/*/tests/ + + ./vendor/react/dns/tests/FunctionalResolverTest.php + ./vendor/react/dns/tests/Query/CoopExecutorTest.php + ./vendor/react/dns/tests/Query/SelectiveTransportExecutorTest.php From 4040b609cac80184286721a7a595cd4b1120a7a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sat, 11 Jul 2020 15:38:46 +0200 Subject: [PATCH 05/36] Add HTTP client and server implementation via react/http --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index b56807fc..d9e908cb 100644 --- a/composer.json +++ b/composer.json @@ -12,6 +12,7 @@ "react/cache": "^1.0", "react/dns": "^1.3", "react/event-loop": "^1.0", + "react/http": "^1.0", "react/promise": "^2.1 || ^1.2", "react/promise-stream": "^1.1.1", "react/promise-timer": "^1.6", From 527e5cc6c88c85858b39f1a58e32f3173f5233c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sat, 11 Jul 2020 18:33:07 +0200 Subject: [PATCH 06/36] Prepare v1.1.0 release --- CHANGELOG.md | 13 +++++++++++++ README.md | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f64ba9f..061cbd27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 1.1.0 (2020-07-11) + +A major new feature release, see [**release announcement**](https://clue.engineering/2020/announcing-reactphp-http). + +* Feature: Add event-driven, streaming HTTP client and server implementation via [`react/http`](https://reactphp.org/http/). + (#440 by @clue) + +* Update documentation to link to project meta repo and link to our official Gitter chat room. + (#432 and #433 by @clue) + +* Improve test suite to run tests on PHP 7.4 and add `.gitattributes` to exclude dev files from exports. + (#434 by @reedy and #439 by @clue) + ## 1.0.0 (2019-07-11) * First stable LTS release, now following [SemVer](https://semver.org/). diff --git a/README.md b/README.md index b8d6aa53..6c4e13e3 100644 --- a/README.md +++ b/README.md @@ -201,7 +201,7 @@ installed like this: ```bash # quick protoyping only: install all stable components -$ composer require react/react:^1.0 +$ composer require react/react:^1.1 ``` For more details, check out [ReactPHP's homepage](https://reactphp.org) for From c6f3bab8ab87a567b0a9b72a880f56568e5fb5e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Fri, 22 Jan 2021 19:51:22 +0100 Subject: [PATCH 07/36] Use GitHub actions for continuous integration (CI) Bye bye Travis CI, you've served us well. --- .gitattributes | 2 +- .github/workflows/ci.yml | 42 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 26 ------------------------- README.md | 4 ++-- 4 files changed, 45 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.gitattributes b/.gitattributes index 982c460d..4a09071e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,5 @@ /.gitattributes export-ignore +/.github/ export-ignore /.gitignore export-ignore -/.travis.yml export-ignore /phpunit.xml.dist export-ignore /tests export-ignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..4be7ca28 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +on: + push: + pull_request: + +jobs: + PHPUnit: + name: PHPUnit (PHP ${{ matrix.php }}) + runs-on: ubuntu-18.04 + strategy: + matrix: + php: + - 7.4 + - 7.3 + - 7.2 + - 7.1 + - 7.0 + - 5.6 + - 5.5 + - 5.4 + - 5.3 + steps: + - uses: actions/checkout@v2 + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: xdebug + - run: composer install + - run: vendor/bin/phpunit --coverage-text --exclude-group internet + + PHPUnit-hhvm: + name: PHPUnit (HHVM) + runs-on: ubuntu-18.04 + continue-on-error: true + steps: + - uses: actions/checkout@v2 + - uses: azjezz/setup-hhvm@v1 + with: + version: lts-3.30 + - run: hhvm $(which composer) require phpunit/phpunit:^5 --dev # requires legacy phpunit + - run: hhvm vendor/bin/phpunit --exclude-group internet diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bc648517..00000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: php - -# lock distro so new future defaults will not break the build -dist: trusty - -matrix: - include: - - php: 5.3 - dist: precise - - php: 5.4 - - php: 5.5 - - php: 5.6 - - php: 7.0 - - php: 7.1 - - php: 7.2 - - php: 7.3 - - php: 7.4 - - php: hhvm-3.18 - allow_failures: - - php: hhvm-3.18 - -install: - - composer install --no-interaction - -script: - - php vendor/bin/phpunit --coverage-text --exclude-group internet diff --git a/README.md b/README.md index 6c4e13e3..ba93429a 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@
- Build Status + Build Status

@@ -265,7 +265,7 @@ $ php vendor/bin/phpunit The test suite also contains a number of functional integration tests that rely on a stable internet connection. Due to the vast number of integration tests, -these are skipped by default on Travis CI. If you also do not want to run these, +these are skipped by default during CI runs. If you also do not want to run these, they can simply be skipped like this: ```bash From 69c680cb311107a65a6c8fe0ed9a636717cbb3ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sat, 10 Jul 2021 10:03:18 +0200 Subject: [PATCH 08/36] Simplify usage by supporting new default loop --- README.md | 19 +++++++++++++++++++ composer.json | 12 ++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ba93429a..19e5da55 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,25 @@ Streams abstraction, async DNS resolver, network client/server, HTTP client/server and interaction with processes. Third-party libraries can use these components to create async network clients/servers and more. +```php +$server = new React\Http\Server(function (Psr\Http\Message\ServerRequestInterface $request) { + return new React\Http\Message\Response( + 200, + array( + 'Content-Type' => 'text/plain' + ), + "Hello World!\n" + ); +}); + +$socket = new React\Socket\Server('127.0.0.1:8080'); +$server->listen($socket); + +echo "Server running at http://127.0.0.1:8080" . PHP_EOL; +``` + +This simple web server written in ReactPHP responds with "Hello World!" for every request. + ReactPHP is production ready and battle-tested with millions of installations from all kinds of projects around the world. Its event-driven architecture makes it a perfect fit for efficient network servers and clients handling hundreds or diff --git a/composer.json b/composer.json index d9e908cb..1045b721 100644 --- a/composer.json +++ b/composer.json @@ -10,14 +10,14 @@ "require": { "php": ">=5.3.8", "react/cache": "^1.0", - "react/dns": "^1.3", - "react/event-loop": "^1.0", - "react/http": "^1.0", + "react/dns": "^1.8", + "react/event-loop": "^1.2", + "react/http": "^1.4", "react/promise": "^2.1 || ^1.2", "react/promise-stream": "^1.1.1", - "react/promise-timer": "^1.6", - "react/socket": "^1.4", - "react/stream": "^1.0" + "react/promise-timer": "^1.7", + "react/socket": "^1.8", + "react/stream": "^1.2" }, "require-dev": { "clue/block-react": "^1.1", From e8b02e710c3659d548f30b73d6ed93d18ca57b0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Tue, 9 Mar 2021 17:10:23 +0100 Subject: [PATCH 09/36] Don't skip tests on PHP 7.4 now that this has been fixed upstream --- phpunit.xml.dist | 4 ---- 1 file changed, 4 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 4dc40d79..1cf2f8a6 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -4,10 +4,6 @@ ./vendor/react/*/tests/ - - ./vendor/react/dns/tests/FunctionalResolverTest.php - ./vendor/react/dns/tests/Query/CoopExecutorTest.php - ./vendor/react/dns/tests/Query/SelectiveTransportExecutorTest.php From 5e74f4a0eaa13f558ede10d5ca50622edeee2c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sun, 11 Jul 2021 15:28:52 +0200 Subject: [PATCH 10/36] Skip bogus test failures --- phpunit.xml.dist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 1cf2f8a6..69bbf0ea 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -4,6 +4,8 @@ ./vendor/react/*/tests/ + + ./vendor/react/event-loop/tests/BinTest.php From 1967584fde3d434d356b32b054e89ed5c1887c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sun, 11 Jul 2021 15:39:02 +0200 Subject: [PATCH 11/36] Prepare v1.2.0 release --- CHANGELOG.md | 7 +++++++ README.md | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 061cbd27..c588ac1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 1.2.0 (2021-07-11) + +A major new feature release, see [**release announcement**](https://clue.engineering/2021/announcing-reactphp-default-loop). + +* Feature: Simplify usage by supporting new [default loop](https://reactphp.org/event-loop/#loop). + (#445 by @clue) + ## 1.1.0 (2020-07-11) A major new feature release, see [**release announcement**](https://clue.engineering/2020/announcing-reactphp-http). diff --git a/README.md b/README.md index 19e5da55..0adc0fb1 100644 --- a/README.md +++ b/README.md @@ -220,7 +220,7 @@ installed like this: ```bash # quick protoyping only: install all stable components -$ composer require react/react:^1.1 +$ composer require react/react:^1.2 ``` For more details, check out [ReactPHP's homepage](https://reactphp.org) for From 099e24268215c0a739d805b5ecb477eb64ba5af8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sat, 7 Aug 2021 11:57:01 +0200 Subject: [PATCH 12/36] Update HTTP server example for reactphp/http v1.5.0 --- README.md | 4 ++-- composer.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0adc0fb1..d4d54303 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ client/server and interaction with processes. Third-party libraries can use thes components to create async network clients/servers and more. ```php -$server = new React\Http\Server(function (Psr\Http\Message\ServerRequestInterface $request) { +$server = new React\Http\HttpServer(function (Psr\Http\Message\ServerRequestInterface $request) { return new React\Http\Message\Response( 200, array( @@ -33,7 +33,7 @@ $server = new React\Http\Server(function (Psr\Http\Message\ServerRequestInterfac ); }); -$socket = new React\Socket\Server('127.0.0.1:8080'); +$socket = new React\Socket\SocketServer('127.0.0.1:8080'); $server->listen($socket); echo "Server running at http://127.0.0.1:8080" . PHP_EOL; diff --git a/composer.json b/composer.json index 1045b721..731113fe 100644 --- a/composer.json +++ b/composer.json @@ -12,11 +12,11 @@ "react/cache": "^1.0", "react/dns": "^1.8", "react/event-loop": "^1.2", - "react/http": "^1.4", + "react/http": "^1.5", "react/promise": "^2.1 || ^1.2", "react/promise-stream": "^1.1.1", "react/promise-timer": "^1.7", - "react/socket": "^1.8", + "react/socket": "^1.9", "react/stream": "^1.2" }, "require-dev": { From 2aec8c918486fac5428f83b0f445c1ce0cfe8dc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Thu, 3 Feb 2022 15:31:17 +0100 Subject: [PATCH 13/36] Update HTTP server example for reactphp/http v1.6.0 --- README.md | 6 +----- composer.json | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d4d54303..adfd7c3d 100644 --- a/README.md +++ b/README.md @@ -24,11 +24,7 @@ components to create async network clients/servers and more. ```php $server = new React\Http\HttpServer(function (Psr\Http\Message\ServerRequestInterface $request) { - return new React\Http\Message\Response( - 200, - array( - 'Content-Type' => 'text/plain' - ), + return React\Http\Message\Response::plaintext( "Hello World!\n" ); }); diff --git a/composer.json b/composer.json index 731113fe..b3706086 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "react/cache": "^1.0", "react/dns": "^1.8", "react/event-loop": "^1.2", - "react/http": "^1.5", + "react/http": "^1.6", "react/promise": "^2.1 || ^1.2", "react/promise-stream": "^1.1.1", "react/promise-timer": "^1.7", From db19ce4e7ca9afa4c3452addecde7955de1bb472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Fri, 4 Feb 2022 09:07:03 +0100 Subject: [PATCH 14/36] Skip bogus test failures --- phpunit.xml.dist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 69bbf0ea..2b235aaa 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -6,6 +6,8 @@ ./vendor/react/*/tests/ ./vendor/react/event-loop/tests/BinTest.php + + ./vendor/react/http/tests/HttpServerTest.php From 67f301da4cca8736b7a1aa18897f74818f542160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Fri, 4 Feb 2022 08:06:03 +0100 Subject: [PATCH 15/36] Update test suite to support PHPUnit 9 --- .gitattributes | 3 ++- .github/workflows/ci.yml | 5 ++++- composer.json | 10 +++++----- phpunit.xml.dist | 16 ++++++++++------ phpunit.xml.legacy | 22 ++++++++++++++++++++++ 5 files changed, 43 insertions(+), 13 deletions(-) create mode 100644 phpunit.xml.legacy diff --git a/.gitattributes b/.gitattributes index 4a09071e..21be40ca 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,4 +2,5 @@ /.github/ export-ignore /.gitignore export-ignore /phpunit.xml.dist export-ignore -/tests export-ignore +/phpunit.xml.legacy export-ignore +/tests/ export-ignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4be7ca28..02ec2a25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,9 @@ jobs: coverage: xdebug - run: composer install - run: vendor/bin/phpunit --coverage-text --exclude-group internet + if: ${{ matrix.php >= 7.3 }} + - run: vendor/bin/phpunit --coverage-text --exclude-group internet -c phpunit.xml.legacy + if: ${{ matrix.php < 7.3 }} PHPUnit-hhvm: name: PHPUnit (HHVM) @@ -38,5 +41,5 @@ jobs: - uses: azjezz/setup-hhvm@v1 with: version: lts-3.30 - - run: hhvm $(which composer) require phpunit/phpunit:^5 --dev # requires legacy phpunit + - run: hhvm $(which composer) install - run: hhvm vendor/bin/phpunit --exclude-group internet diff --git a/composer.json b/composer.json index b3706086..42ce9ddf 100644 --- a/composer.json +++ b/composer.json @@ -9,20 +9,20 @@ }, "require": { "php": ">=5.3.8", - "react/cache": "^1.0", + "react/cache": "^1.1", "react/dns": "^1.8", "react/event-loop": "^1.2", "react/http": "^1.6", - "react/promise": "^2.1 || ^1.2", - "react/promise-stream": "^1.1.1", + "react/promise": "^2.8 || ^1.2", + "react/promise-stream": "^1.3", "react/promise-timer": "^1.7", "react/socket": "^1.9", "react/stream": "^1.2" }, "require-dev": { - "clue/block-react": "^1.1", + "clue/block-react": "^1.5", "clue/stream-filter": "^1.3", - "phpunit/phpunit": "^7.0 || ^6.0 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" }, "config": { "preferred-install": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 2b235aaa..918f9b84 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,6 +1,11 @@ - + + ./vendor/react/*/tests/ @@ -10,10 +15,9 @@ ./vendor/react/http/tests/HttpServerTest.php - - - + + ./vendor/react/*/src/ - - + + diff --git a/phpunit.xml.legacy b/phpunit.xml.legacy new file mode 100644 index 00000000..35922e02 --- /dev/null +++ b/phpunit.xml.legacy @@ -0,0 +1,22 @@ + + + + + + + ./vendor/react/*/tests/ + + ./vendor/react/event-loop/tests/BinTest.php + + ./vendor/react/http/tests/HttpServerTest.php + + + + + ./vendor/react/*/src/ + + + From 767d11e86b66a08703c5ad8b849b9939e872eafb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Fri, 11 Feb 2022 11:54:00 +0100 Subject: [PATCH 16/36] Support PHP 8.1 release --- .github/workflows/ci.yml | 2 ++ composer.json | 8 ++++---- phpunit.xml.dist | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02ec2a25..75d8208f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,8 @@ jobs: strategy: matrix: php: + - 8.1 + - 8.0 - 7.4 - 7.3 - 7.2 diff --git a/composer.json b/composer.json index 42ce9ddf..7ff078e4 100644 --- a/composer.json +++ b/composer.json @@ -10,13 +10,13 @@ "require": { "php": ">=5.3.8", "react/cache": "^1.1", - "react/dns": "^1.8", + "react/dns": "^1.9", "react/event-loop": "^1.2", "react/http": "^1.6", - "react/promise": "^2.8 || ^1.2", + "react/promise": "^2.9 || ^1.2", "react/promise-stream": "^1.3", - "react/promise-timer": "^1.7", - "react/socket": "^1.9", + "react/promise-timer": "^1.8", + "react/socket": "^1.11", "react/stream": "^1.2" }, "require-dev": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 918f9b84..fdf4d22a 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -5,12 +5,14 @@ xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd" bootstrap="tests/bootstrap.php" cacheResult="false" - colors="true"> + colors="true" + convertDeprecationsToExceptions="true"> ./vendor/react/*/tests/ ./vendor/react/event-loop/tests/BinTest.php + ./vendor/react/event-loop/tests/ExtLibeventLoopTest.php ./vendor/react/http/tests/HttpServerTest.php From 2c2019a8786c9318129841ae84a90ca77d66d9f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Fri, 18 Mar 2022 18:14:49 +0100 Subject: [PATCH 17/36] Update test suite to avoid skipping EventLoop tests --- composer.json | 2 +- phpunit.xml.dist | 3 --- phpunit.xml.legacy | 2 -- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 7ff078e4..1db55ded 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "php": ">=5.3.8", "react/cache": "^1.1", "react/dns": "^1.9", - "react/event-loop": "^1.2", + "react/event-loop": "^1.3", "react/http": "^1.6", "react/promise": "^2.9 || ^1.2", "react/promise-stream": "^1.3", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index fdf4d22a..15445651 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -10,9 +10,6 @@ ./vendor/react/*/tests/ - - ./vendor/react/event-loop/tests/BinTest.php - ./vendor/react/event-loop/tests/ExtLibeventLoopTest.php ./vendor/react/http/tests/HttpServerTest.php diff --git a/phpunit.xml.legacy b/phpunit.xml.legacy index 35922e02..8a0d9b7f 100644 --- a/phpunit.xml.legacy +++ b/phpunit.xml.legacy @@ -8,8 +8,6 @@ ./vendor/react/*/tests/ - - ./vendor/react/event-loop/tests/BinTest.php ./vendor/react/http/tests/HttpServerTest.php From 407f9a928750c5a4a239d98555952818625594f4 Mon Sep 17 00:00:00 2001 From: Simon Frings Date: Tue, 12 Apr 2022 10:59:33 +0200 Subject: [PATCH 18/36] Fix legacy HHVM build by downgrading Composer --- .github/workflows/ci.yml | 1 + README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75d8208f..90bced73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,5 +43,6 @@ jobs: - uses: azjezz/setup-hhvm@v1 with: version: lts-3.30 + - run: composer self-update --2.2 # downgrade Composer for HHVM - run: hhvm $(which composer) install - run: hhvm vendor/bin/phpunit --exclude-group internet diff --git a/README.md b/README.md index adfd7c3d..2e7700b2 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@
- Build Status + Build Status

From a01b9cd36a597f13260025e0ffe3c218dba095b5 Mon Sep 17 00:00:00 2001 From: Nicolas Hedger Date: Mon, 20 Jun 2022 16:59:20 +0200 Subject: [PATCH 19/36] chore(docs): remove leading dollar sign --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2e7700b2..7f1c6e31 100644 --- a/README.md +++ b/README.md @@ -206,7 +206,7 @@ For example, this may look something like this: ```bash # recommended install: pick required components -$ composer require react/event-loop react/http +composer require react/event-loop react/http ``` As an alternative, we also provide a meta package that will install all stable @@ -216,7 +216,7 @@ installed like this: ```bash # quick protoyping only: install all stable components -$ composer require react/react:^1.2 +composer require react/react:^1.2 ``` For more details, check out [ReactPHP's homepage](https://reactphp.org) for @@ -269,13 +269,13 @@ To run the test suite, you first need to clone this repo and then install all dependencies [through Composer](https://getcomposer.org): ```bash -$ composer install +composer install ``` To run the test suite, go to the project root and run: ```bash -$ php vendor/bin/phpunit +vendor/bin/phpunit ``` The test suite also contains a number of functional integration tests that rely @@ -284,7 +284,7 @@ these are skipped by default during CI runs. If you also do not want to run thes they can simply be skipped like this: ```bash -$ php vendor/bin/phpunit --exclude-group internet +vendor/bin/phpunit --exclude-group internet ``` ## License From 2f8eb2f54cf8609003fead4d8b2baf53f5f688e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sat, 2 Jul 2022 12:01:13 +0200 Subject: [PATCH 20/36] Add new Async component to core components --- .github/workflows/ci.yml | 2 +- README.md | 3 +++ composer.json | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 90bced73..7759d40c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,5 +44,5 @@ jobs: with: version: lts-3.30 - run: composer self-update --2.2 # downgrade Composer for HHVM - - run: hhvm $(which composer) install + - run: hhvm $(which composer) require react/async:^2@dev # downgrade Async component for HHVM - run: hhvm vendor/bin/phpunit --exclude-group internet diff --git a/README.md b/README.md index 7f1c6e31..746374b9 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,9 @@ Node.js (V8). Promises/A implementation for PHP. [Read the documentation](https://github.com/reactphp/promise) +* **Async** + Async utilities and fibers for ReactPHP. + [Read the documentation](https://github.com/reactphp/async) ## Network Components diff --git a/composer.json b/composer.json index 1db55ded..b632d081 100644 --- a/composer.json +++ b/composer.json @@ -9,6 +9,7 @@ }, "require": { "php": ">=5.3.8", + "react/async": "^4@dev || ^3@dev || ^2@dev", "react/cache": "^1.1", "react/dns": "^1.9", "react/event-loop": "^1.3", From 18df373539bd9863b8e685767c35ab2628d0be88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sun, 10 Jul 2022 17:53:52 +0200 Subject: [PATCH 21/36] Update to stable releases of new Async component --- .github/workflows/ci.yml | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7759d40c..39888dbb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,5 +44,5 @@ jobs: with: version: lts-3.30 - run: composer self-update --2.2 # downgrade Composer for HHVM - - run: hhvm $(which composer) require react/async:^2@dev # downgrade Async component for HHVM + - run: hhvm $(which composer) require react/async:^2 # downgrade Async component for HHVM - run: hhvm vendor/bin/phpunit --exclude-group internet diff --git a/composer.json b/composer.json index b632d081..64f517de 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ }, "require": { "php": ">=5.3.8", - "react/async": "^4@dev || ^3@dev || ^2@dev", + "react/async": "^4 || ^3 || ^2", "react/cache": "^1.1", "react/dns": "^1.9", "react/event-loop": "^1.3", From d442dfe0e4b59f5d46c6604a6d502b6031129d4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Fri, 24 Jun 2022 12:23:07 +0200 Subject: [PATCH 22/36] Improve quickstart example, update HTTP component description --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7f1c6e31..fd21baf3 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,13 @@ client/server and interaction with processes. Third-party libraries can use thes components to create async network clients/servers and more. ```php + Date: Mon, 11 Jul 2022 16:40:40 +0200 Subject: [PATCH 23/36] Prepare v1.3.0 release --- CHANGELOG.md | 16 ++++++++++++++++ README.md | 10 +++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c588ac1f..45b68ac2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 1.3.0 (2022-07-11) + +A major new feature release, see [**release announcement**](https://clue.engineering/2022/announcing-reactphp-async). + +* Feature: Add new Async component to core components. + (#458 by @clue) + +* Feature: Support PHP 8.1 release. + (#451 by @clue) + +* Improve documentation, update HTTP server example for reactphp/http v1.6.0 release. + (#449 and #459 by @clue and #457 by @nhedger) + +* Improve test suite, support PHPUnit 9 and update dependencies to avoid skipping tests. + (#450 and #454 by @clue and #455 by @SimonFrings) + ## 1.2.0 (2021-07-11) A major new feature release, see [**release announcement**](https://clue.engineering/2021/announcing-reactphp-default-loop). diff --git a/README.md b/README.md index eb2b73d4..4cf54602 100644 --- a/README.md +++ b/README.md @@ -202,8 +202,8 @@ This means that instead of installing something like a "ReactPHP framework", you pick only the components that you need. This project follows [SemVer](https://semver.org/) for all its stable components. -The recommended way to install these components is [through Composer](https://getcomposer.org). -[New to Composer?](http://getcomposer.org/doc/00-intro.md) +The recommended way to install these components is [through Composer](https://getcomposer.org/). +[New to Composer?](https://getcomposer.org/doc/00-intro.md) For example, this may look something like this: @@ -219,10 +219,10 @@ installed like this: ```bash # quick protoyping only: install all stable components -composer require react/react:^1.2 +composer require react/react:^1.3 ``` -For more details, check out [ReactPHP's homepage](https://reactphp.org) for +For more details, check out [ReactPHP's homepage](https://reactphp.org/) for quickstart examples and usage details. See also the combined [changelog for all ReactPHP components](https://reactphp.org/changelog.html) @@ -269,7 +269,7 @@ Thank you! ## Tests To run the test suite, you first need to clone this repo and then install all -dependencies [through Composer](https://getcomposer.org): +dependencies [through Composer](https://getcomposer.org/): ```bash composer install From 342c5e1b2ca53befe73e0e18f7e610c0241bba8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Wed, 10 Aug 2022 19:11:49 +0200 Subject: [PATCH 24/36] Update test suite to use new reactphp/async package --- composer.json | 9 ++++----- phpunit.xml.dist | 4 ++-- phpunit.xml.legacy | 2 -- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 64f517de..175d9b5c 100644 --- a/composer.json +++ b/composer.json @@ -11,17 +11,16 @@ "php": ">=5.3.8", "react/async": "^4 || ^3 || ^2", "react/cache": "^1.1", - "react/dns": "^1.9", + "react/dns": "^1.10", "react/event-loop": "^1.3", - "react/http": "^1.6", + "react/http": "^1.7", "react/promise": "^2.9 || ^1.2", - "react/promise-stream": "^1.3", + "react/promise-stream": "^1.5", "react/promise-timer": "^1.8", - "react/socket": "^1.11", + "react/socket": "^1.12", "react/stream": "^1.2" }, "require-dev": { - "clue/block-react": "^1.5", "clue/stream-filter": "^1.3", "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" }, diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 15445651..419e177a 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -9,9 +9,9 @@ convertDeprecationsToExceptions="true"> + + ./vendor/react/event-loop/tests/ ./vendor/react/*/tests/ - - ./vendor/react/http/tests/HttpServerTest.php diff --git a/phpunit.xml.legacy b/phpunit.xml.legacy index 8a0d9b7f..00fceeb4 100644 --- a/phpunit.xml.legacy +++ b/phpunit.xml.legacy @@ -8,8 +8,6 @@ ./vendor/react/*/tests/ - - ./vendor/react/http/tests/HttpServerTest.php From cdfd338a5221f9fcaa9d9d7e169b61f5ca4b7268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Mon, 5 Sep 2022 17:21:52 +0200 Subject: [PATCH 25/36] Forward compatibility with upcoming Promise v3 --- .github/workflows/ci.yml | 2 +- composer.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39888dbb..03f03c6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,5 +44,5 @@ jobs: with: version: lts-3.30 - run: composer self-update --2.2 # downgrade Composer for HHVM - - run: hhvm $(which composer) require react/async:^2 # downgrade Async component for HHVM + - run: hhvm $(which composer) require react/async:^2 react/promise:^2 # downgrade Async and Promise for HHVM - run: hhvm vendor/bin/phpunit --exclude-group internet diff --git a/composer.json b/composer.json index 175d9b5c..c871aed0 100644 --- a/composer.json +++ b/composer.json @@ -13,10 +13,10 @@ "react/cache": "^1.1", "react/dns": "^1.10", "react/event-loop": "^1.3", - "react/http": "^1.7", - "react/promise": "^2.9 || ^1.2", + "react/http": "^1.8@dev || ^1.7", + "react/promise": "^3@dev || ^2.9 || ^1.2", "react/promise-stream": "^1.5", - "react/promise-timer": "^1.8", + "react/promise-timer": "^1.9", "react/socket": "^1.12", "react/stream": "^1.2" }, From ff84cf3c939868a853cd955f1d8446335dfb9608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Thu, 29 Sep 2022 16:34:24 +0200 Subject: [PATCH 26/36] Update to stable reactphp/http v1.8.0 --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index c871aed0..ea8d6513 100644 --- a/composer.json +++ b/composer.json @@ -13,8 +13,8 @@ "react/cache": "^1.1", "react/dns": "^1.10", "react/event-loop": "^1.3", - "react/http": "^1.8@dev || ^1.7", - "react/promise": "^3@dev || ^2.9 || ^1.2", + "react/http": "^1.8", + "react/promise": "^3 || ^2.9 || ^1.2", "react/promise-stream": "^1.5", "react/promise-timer": "^1.9", "react/socket": "^1.12", From ba05d1f3ef5e442d2e7aaef71856a718aa96096b Mon Sep 17 00:00:00 2001 From: Simon Frings Date: Tue, 6 Sep 2022 16:27:06 +0200 Subject: [PATCH 27/36] Add issue template for better orientation --- .github/ISSUE_TEMPLATE/bug.md | 11 +++++++++++ .github/ISSUE_TEMPLATE/config.yml | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 00000000..d26fe152 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -0,0 +1,11 @@ +--- +name: Bug report +about: Found a bug in our project? Create a report to help us improve. +labels: bug +--- + + + +```php +// Please add code examples if possible, so we can reproduce your steps +``` diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..4b4a0ea6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +blank_issues_enabled: false +contact_links: + - name: Report a security vulnerability + url: https://reactphp.org/#support + about: 'If you discover a security vulnerability, please send us an email. Do not disclose security-related issues publicly.' + - name: Feature request + url: https://github.com/orgs/reactphp/discussions/categories/ideas + about: 'You have ideas to improve our project? Start a new discussion in our "Ideas" category.' + - name: Questions + url: https://github.com/orgs/reactphp/discussions/categories/q-a + about: 'We are happy to answer your questions! Start a new discussion in our "Q&A" category.' From a438579f053bcc4ac0b0532228ad5b60df410198 Mon Sep 17 00:00:00 2001 From: Niels Vanpachtenbeke <10651054+Nielsvanpach@users.noreply.github.com> Date: Thu, 29 Dec 2022 10:48:38 +0100 Subject: [PATCH 28/36] run ci with php 8.2 --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03f03c6f..55dd7f32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,7 @@ jobs: strategy: matrix: php: + - 8.2 - 8.1 - 8.0 - 7.4 From e87800c9a243713d19058e15a0623c6978d4ab4a Mon Sep 17 00:00:00 2001 From: Simon Frings Date: Mon, 9 Jan 2023 12:47:33 +0100 Subject: [PATCH 29/36] Revert issue template changes to use organisation issue template --- .github/ISSUE_TEMPLATE/bug.md | 11 ----------- .github/ISSUE_TEMPLATE/config.yml | 11 ----------- 2 files changed, 22 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug.md delete mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md deleted file mode 100644 index d26fe152..00000000 --- a/.github/ISSUE_TEMPLATE/bug.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -name: Bug report -about: Found a bug in our project? Create a report to help us improve. -labels: bug ---- - - - -```php -// Please add code examples if possible, so we can reproduce your steps -``` diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 4b4a0ea6..00000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,11 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Report a security vulnerability - url: https://reactphp.org/#support - about: 'If you discover a security vulnerability, please send us an email. Do not disclose security-related issues publicly.' - - name: Feature request - url: https://github.com/orgs/reactphp/discussions/categories/ideas - about: 'You have ideas to improve our project? Start a new discussion in our "Ideas" category.' - - name: Questions - url: https://github.com/orgs/reactphp/discussions/categories/q-a - about: 'We are happy to answer your questions! Start a new discussion in our "Q&A" category.' From 300bfaf43ebca786d52e16d353766c2669113c5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sun, 15 Jan 2023 16:07:36 +0100 Subject: [PATCH 30/36] Update test suite and report failed assertions --- .github/workflows/ci.yml | 26 +++++++++++++++++--------- composer.json | 12 ++++++------ phpunit.xml.dist | 12 ++++++++++-- phpunit.xml.legacy | 10 +++++++++- 4 files changed, 42 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 55dd7f32..87704d9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ on: jobs: PHPUnit: name: PHPUnit (PHP ${{ matrix.php }}) - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 strategy: matrix: php: @@ -24,11 +24,16 @@ jobs: - 5.4 - 5.3 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} coverage: xdebug + ini-file: development + ini-values: disable_functions='' # do not disable PCNTL functions on PHP < 8.1 + extensions: sockets, pcntl + env: + fail-fast: true # fail step if any extension can not be installed - run: composer install - run: vendor/bin/phpunit --coverage-text --exclude-group internet if: ${{ matrix.php >= 7.3 }} @@ -37,13 +42,16 @@ jobs: PHPUnit-hhvm: name: PHPUnit (HHVM) - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 continue-on-error: true steps: - - uses: actions/checkout@v2 - - uses: azjezz/setup-hhvm@v1 + - uses: actions/checkout@v3 + - run: cp "$(which composer)" composer.phar && ./composer.phar self-update --2.2 # downgrade Composer for HHVM + - name: Run hhvm composer.phar require react/async:^2 react/promise:^2 # downgrade Async and Promise for HHVM + uses: docker://hhvm/hhvm:3.30-lts-latest with: - version: lts-3.30 - - run: composer self-update --2.2 # downgrade Composer for HHVM - - run: hhvm $(which composer) require react/async:^2 react/promise:^2 # downgrade Async and Promise for HHVM - - run: hhvm vendor/bin/phpunit --exclude-group internet + args: hhvm composer.phar require react/async:^2 react/promise:^2 + - name: Run hhvm vendor/bin/phpunit --exclude-group internet + uses: docker://hhvm/hhvm:3.30-lts-latest + with: + args: hhvm vendor/bin/phpunit --exclude-group internet diff --git a/composer.json b/composer.json index ea8d6513..3515e769 100644 --- a/composer.json +++ b/composer.json @@ -11,18 +11,18 @@ "php": ">=5.3.8", "react/async": "^4 || ^3 || ^2", "react/cache": "^1.1", - "react/dns": "^1.10", - "react/event-loop": "^1.3", + "react/dns": "^1.11", + "react/event-loop": "^1.4", "react/http": "^1.8", - "react/promise": "^3 || ^2.9 || ^1.2", + "react/promise": "^3 || ^2.10 || ^1.2", "react/promise-stream": "^1.5", "react/promise-timer": "^1.9", - "react/socket": "^1.12", - "react/stream": "^1.2" + "react/socket": "^1.13", + "react/stream": "^1.3" }, "require-dev": { "clue/stream-filter": "^1.3", - "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, "config": { "preferred-install": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 419e177a..d5d26a2e 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,8 +1,8 @@ - + ./vendor/react/*/src/ + + + + + + + +
diff --git a/phpunit.xml.legacy b/phpunit.xml.legacy index 00fceeb4..2cd2f9b1 100644 --- a/phpunit.xml.legacy +++ b/phpunit.xml.legacy @@ -1,6 +1,6 @@ - + ./vendor/react/*/src/ + + + + + + + + From 4b502d054df09fd33d0fd666fe9cb77ade977e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Tue, 4 Jul 2023 22:59:58 +0200 Subject: [PATCH 31/36] Update test suite to avoid unhandled promise rejections --- .github/workflows/ci.yml | 4 ++-- composer.json | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87704d9a..2cc7f0ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,10 +47,10 @@ jobs: steps: - uses: actions/checkout@v3 - run: cp "$(which composer)" composer.phar && ./composer.phar self-update --2.2 # downgrade Composer for HHVM - - name: Run hhvm composer.phar require react/async:^2 react/promise:^2 # downgrade Async and Promise for HHVM + - name: Run hhvm composer.phar require --dev react/async:^2 react/promise:^2 phpunit/phpunit:^5.7 # downgrade Async and Promise for HHVM uses: docker://hhvm/hhvm:3.30-lts-latest with: - args: hhvm composer.phar require react/async:^2 react/promise:^2 + args: hhvm composer.phar require --dev react/async:^2 react/promise:^2 phpunit/phpunit:^5.7 - name: Run hhvm vendor/bin/phpunit --exclude-group internet uses: docker://hhvm/hhvm:3.30-lts-latest with: diff --git a/composer.json b/composer.json index 3515e769..d50528c6 100644 --- a/composer.json +++ b/composer.json @@ -15,14 +15,21 @@ "react/event-loop": "^1.4", "react/http": "^1.8", "react/promise": "^3 || ^2.10 || ^1.2", - "react/promise-stream": "^1.5", + "react/promise-stream": "^1.6", "react/promise-timer": "^1.9", "react/socket": "^1.13", "react/stream": "^1.3" }, "require-dev": { "clue/stream-filter": "^1.3", - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + "phpunit/phpunit": "^9.6 || ^7.5 || ^5.7 || ^4.8.36", + "react/async": "^4.2@dev || ^3.2@dev || ^4 || ^3 || ^2", + "react/dns": "^1.12@dev", + "react/http": "^1.10@dev", + "react/promise": "^3@dev || ^2.10 || ^1.2", + "react/promise-stream": "^1.7@dev", + "react/promise-timer": "^1.10@dev", + "react/socket": "^1.14@dev" }, "config": { "preferred-install": { From 726e5de40567c9effaa8e5665b1a2621af8d7ee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Tue, 11 Jul 2023 18:08:54 +0200 Subject: [PATCH 32/36] Prepare v1.4.0 release --- CHANGELOG.md | 13 +++++++++++++ README.md | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45b68ac2..f5f711e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 1.4.0 (2023-07-11) + +A major new feature release, see [**release announcement**](https://clue.engineering/2023/announcing-reactphp-promise-v3). + +* Feature: Add support for new Promise v3 release. + (#464 and #524 by @clue) + +* Feature: Support PHP 8.2 release. + (#491 by @Nielsvanpach) + +* Improve test suite, update dependencies and report failed assertions. + (#462 and #501 by @clue and #466 and #492 by @SimonFrings) + ## 1.3.0 (2022-07-11) A major new feature release, see [**release announcement**](https://clue.engineering/2022/announcing-reactphp-async). diff --git a/README.md b/README.md index 4cf54602..f8e1d0f2 100644 --- a/README.md +++ b/README.md @@ -219,7 +219,7 @@ installed like this: ```bash # quick protoyping only: install all stable components -composer require react/react:^1.3 +composer require react/react:^1.4 ``` For more details, check out [ReactPHP's homepage](https://reactphp.org/) for From 24352c38e5827a15527977d0aaa5925d32d926a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Thu, 16 Nov 2023 18:31:40 +0100 Subject: [PATCH 33/36] Update test suite to remove legacy test bootstrapping --- composer.json | 3 +-- tests/bootstrap.php | 18 +++--------------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/composer.json b/composer.json index d50528c6..67676a85 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "react/dns": "^1.11", "react/event-loop": "^1.4", "react/http": "^1.8", - "react/promise": "^3 || ^2.10 || ^1.2", + "react/promise": "^3 || ^2.10 || ^1.3", "react/promise-stream": "^1.6", "react/promise-timer": "^1.9", "react/socket": "^1.13", @@ -26,7 +26,6 @@ "react/async": "^4.2@dev || ^3.2@dev || ^4 || ^3 || ^2", "react/dns": "^1.12@dev", "react/http": "^1.10@dev", - "react/promise": "^3@dev || ^2.10 || ^1.2", "react/promise-stream": "^1.7@dev", "react/promise-timer": "^1.10@dev", "react/socket": "^1.14@dev" diff --git a/tests/bootstrap.php b/tests/bootstrap.php index db5b8cac..2af732cf 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -2,7 +2,9 @@ $autoload = require __DIR__ . '/../vendor/autoload.php'; -// register all `autoload-dev` paths from React's components +assert($autoload instanceof Composer\Autoload\ClassLoader); + +// register all `autoload-dev` paths from ReactPHP's components foreach (glob(__DIR__ . '/../vendor/react/*/composer.json') as $b) { $config = json_decode(file_get_contents($b), true); @@ -15,17 +17,3 @@ } } } - -// load all legacy test bootstrap scripts from React's components -foreach (glob(__DIR__ . '/../vendor/react/*/tests/bootstrap.php') as $b) { - // skip legacy react/promise for now and use manual autoload path from bootstrap config - // @link https://github.com/reactphp/promise/blob/1.x/tests/bootstrap.php - // @link https://github.com/reactphp/promise/blob/2.x/tests/bootstrap.php - if (strpos($b, 'react/promise/tests/bootstrap.php') !== false) { - $autoload->add('React\Promise', __DIR__ . '/../vendor/react/promise/tests'); - $autoload->addPsr4('React\\Promise\\', __DIR__ . '/../vendor/react/promise/tests'); - continue; - } - - include $b; -} From f25e5d8e732618625e1d15ca2ef7745876d345ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sat, 18 Nov 2023 19:19:11 +0100 Subject: [PATCH 34/36] Test on PHP 8.3 and update test environment --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2cc7f0ea..85aad9c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,7 @@ jobs: strategy: matrix: php: + - 8.3 - 8.2 - 8.1 - 8.0 @@ -24,7 +25,7 @@ jobs: - 5.4 - 5.3 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} @@ -45,7 +46,7 @@ jobs: runs-on: ubuntu-22.04 continue-on-error: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: cp "$(which composer)" composer.phar && ./composer.phar self-update --2.2 # downgrade Composer for HHVM - name: Run hhvm composer.phar require --dev react/async:^2 react/promise:^2 phpunit/phpunit:^5.7 # downgrade Async and Promise for HHVM uses: docker://hhvm/hhvm:3.30-lts-latest From 4a396be0b306893ee2a1e38ed306b60600ed4d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sat, 12 Aug 2023 13:50:04 +0200 Subject: [PATCH 35/36] Update test environment to all stable dependencies --- composer.json | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index 67676a85..524986d3 100644 --- a/composer.json +++ b/composer.json @@ -9,26 +9,20 @@ }, "require": { "php": ">=5.3.8", - "react/async": "^4 || ^3 || ^2", + "react/async": "^4.2 || ^3.2 || ^2.2", "react/cache": "^1.1", - "react/dns": "^1.11", + "react/dns": "^1.12", "react/event-loop": "^1.4", - "react/http": "^1.8", + "react/http": "^1.10", "react/promise": "^3 || ^2.10 || ^1.3", - "react/promise-stream": "^1.6", - "react/promise-timer": "^1.9", - "react/socket": "^1.13", + "react/promise-stream": "^1.7", + "react/promise-timer": "^1.10", + "react/socket": "^1.14", "react/stream": "^1.3" }, "require-dev": { "clue/stream-filter": "^1.3", - "phpunit/phpunit": "^9.6 || ^7.5 || ^5.7 || ^4.8.36", - "react/async": "^4.2@dev || ^3.2@dev || ^4 || ^3 || ^2", - "react/dns": "^1.12@dev", - "react/http": "^1.10@dev", - "react/promise-stream": "^1.7@dev", - "react/promise-timer": "^1.10@dev", - "react/socket": "^1.14@dev" + "phpunit/phpunit": "^9.6 || ^7.5 || ^5.7 || ^4.8.36" }, "config": { "preferred-install": { From 88dc8e692a40bc1134406f5f61d1a15313cb38f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Tue, 21 May 2024 19:37:56 +0200 Subject: [PATCH 36/36] Improve PHP 8.4+ support by avoiding implicitly nullable types --- composer.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 524986d3..3f752a63 100644 --- a/composer.json +++ b/composer.json @@ -9,16 +9,16 @@ }, "require": { "php": ">=5.3.8", - "react/async": "^4.2 || ^3.2 || ^2.2", + "react/async": "^4.3 || ^3.2 || ^2.2", "react/cache": "^1.1", - "react/dns": "^1.12", - "react/event-loop": "^1.4", - "react/http": "^1.10", - "react/promise": "^3 || ^2.10 || ^1.3", + "react/dns": "^1.13", + "react/event-loop": "^1.5", + "react/http": "^1.11", + "react/promise": "^3.2 || ^2.10 || ^1.3", "react/promise-stream": "^1.7", - "react/promise-timer": "^1.10", - "react/socket": "^1.14", - "react/stream": "^1.3" + "react/promise-timer": "^1.11", + "react/socket": "^1.15", + "react/stream": "^1.4" }, "require-dev": { "clue/stream-filter": "^1.3",