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 01/25] 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 02/25] 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 03/25] 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 04/25] 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 05/25] 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 06/25] 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 07/25] 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 08/25] 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 09/25] 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 10/25] 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 11/25] 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 12/25] 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 13/25] 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 14/25] 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 15/25] 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 16/25] 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 17/25] 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 18/25] 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 19/25] 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 20/25] 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 21/25] 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 22/25] 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 23/25] 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 24/25] 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 25/25] 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",