From b81bcf60647d65e4c847f0094bfb89412721ea43 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 13 Dec 2021 08:42:57 +0100 Subject: [PATCH 1/4] Allow Guzzle 7 & psr7 2.0 Raise minimum version of all deps --- composer.json | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/composer.json b/composer.json index cd393108..139dd7d7 100644 --- a/composer.json +++ b/composer.json @@ -18,26 +18,25 @@ "php": ">=7.4", "ext-curl": "*", "ext-tidy": "*", - "fossar/htmlawed": "^1.2.7", - "http-interop/http-factory-guzzle": "^1.0", - "j0k3r/graby-site-config": "^1.0.110", + "fossar/htmlawed": "^1.2.8", + "guzzlehttp/psr7": "^2.0", + "j0k3r/graby-site-config": "^1.0.141", "j0k3r/httplug-ssrf-plugin": "^2.0", - "j0k3r/php-readability": "^1.2.3", - "monolog/monolog": "^1.18.0|^2.0", - "php-http/client-common": "^2.3", - "php-http/discovery": "^1.12", + "j0k3r/php-readability": "^1.2.9", + "monolog/monolog": "^1.18.0|^2.3", + "php-http/client-common": "^2.5", + "php-http/discovery": "^1.14", "php-http/httplug": "^2.2", - "php-http/message": "^1.9", + "php-http/message": "^1.12", "simplepie/simplepie": "^1.5", "smalot/pdfparser": "^2.0", "symfony/options-resolver": "^3.4|^4.4|^5.3|^6.0", - "true/punycode": "^2.1", - "guzzlehttp/psr7": "^1.5.0" + "true/punycode": "^2.1" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.0", - "guzzlehttp/guzzle": "^6.3.0", - "php-http/guzzle6-adapter": "^2.0", + "guzzlehttp/guzzle": "^7.4", + "php-http/guzzle7-adapter": "^1.0", "php-http/mock-client": "^1.4", "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^1.2", From 8a618b574a8a90fe21bd84487cee7cc80c3eb8f7 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 13 Dec 2021 08:45:38 +0100 Subject: [PATCH 2/4] Update CI --- .github/workflows/continuous-integration.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 18da1301..7ba87027 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -163,7 +163,7 @@ jobs: - name: "Setup adapter: Guzzle 5" run: | - composer remove guzzlehttp/guzzle php-http/guzzle6-adapter --dev -n + composer remove guzzlehttp/guzzle php-http/guzzle7-adapter --dev -n composer require php-http/guzzle5-adapter --dev -n - name: "Setup logs" @@ -172,8 +172,8 @@ jobs: - name: "Run PHPUnit" run: "php vendor/bin/simple-phpunit -v" - phpunit-guzzle7: - name: "PHPUnit (PHP ${{ matrix.php }} and Guzzle 7)" + phpunit-guzzle6: + name: "PHPUnit (PHP ${{ matrix.php }} and Guzzle 6)" runs-on: "ubuntu-20.04" strategy: @@ -201,10 +201,10 @@ jobs: - name: "Install dependencies with Composer" uses: "ramsey/composer-install@v1" - - name: "Setup adapter: Guzzle 7" + - name: "Setup adapter: Guzzle 6" run: | - composer remove guzzlehttp/guzzle php-http/guzzle6-adapter --dev -n - composer require php-http/guzzle7-adapter --dev -n + composer remove guzzlehttp/guzzle php-http/guzzle7-adapter --dev -n + composer require php-http/guzzle6-adapter --dev -n - name: "Setup logs" run: "mkdir -p build/logs" @@ -243,7 +243,7 @@ jobs: - name: "Setup adapter: cURL" run: | - composer remove php-http/guzzle6-adapter --dev -n + composer remove php-http/guzzle7-adapter --dev -n composer require php-http/curl-client --dev -n composer require zendframework/zend-diactoros --dev -n From b8215a2ad38ed8d4cdcdce16c829fa086eac23f6 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 13 Dec 2021 08:46:59 +0100 Subject: [PATCH 3/4] Lowest version of `j0k3r/graby-site-config` set 1.0.139 Because newer version doesn't exist for Composer v1 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 139dd7d7..222e2c27 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "ext-tidy": "*", "fossar/htmlawed": "^1.2.8", "guzzlehttp/psr7": "^2.0", - "j0k3r/graby-site-config": "^1.0.141", + "j0k3r/graby-site-config": "^1.0.139", "j0k3r/httplug-ssrf-plugin": "^2.0", "j0k3r/php-readability": "^1.2.9", "monolog/monolog": "^1.18.0|^2.3", From 4bf5edf03fd86c355f7e444ec0df50f77b9bd70a Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 13 Dec 2021 09:01:31 +0100 Subject: [PATCH 4/4] Drop Guzzle 6 support Because v6 require `guzzlehttp/psr7` v1 and we use v2 for the project. Guzzle 5 isn't affected... > guzzlehttp/guzzle[6.4.0, ..., 6.5.x-dev] require guzzlehttp/psr7 ^1.6.1 -> found guzzlehttp/psr7[1.6.1, ..., 1.x-dev] but it conflicts with your root composer.json require (^2.0). --- .github/workflows/continuous-integration.yml | 41 -------------------- README.md | 14 ++++--- 2 files changed, 8 insertions(+), 47 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 7ba87027..3c1fd247 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -172,46 +172,6 @@ jobs: - name: "Run PHPUnit" run: "php vendor/bin/simple-phpunit -v" - phpunit-guzzle6: - name: "PHPUnit (PHP ${{ matrix.php }} and Guzzle 6)" - runs-on: "ubuntu-20.04" - - strategy: - matrix: - php: - - "7.4" - - steps: - - name: "Checkout" - uses: "actions/checkout@v2" - with: - fetch-depth: 2 - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - php-version: "${{ matrix.php }}" - coverage: "none" - tools: composer:v2 - extensions: tidy - ini-values: "date.timezone=Europe/Paris" - env: - COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: "Install dependencies with Composer" - uses: "ramsey/composer-install@v1" - - - name: "Setup adapter: Guzzle 6" - run: | - composer remove guzzlehttp/guzzle php-http/guzzle7-adapter --dev -n - composer require php-http/guzzle6-adapter --dev -n - - - name: "Setup logs" - run: "mkdir -p build/logs" - - - name: "Run PHPUnit" - run: "php vendor/bin/simple-phpunit -v" - phpunit-curl: name: "PHPUnit (PHP ${{ matrix.php }} and cURL)" runs-on: "ubuntu-20.04" @@ -245,7 +205,6 @@ jobs: run: | composer remove php-http/guzzle7-adapter --dev -n composer require php-http/curl-client --dev -n - composer require zendframework/zend-diactoros --dev -n - name: "Setup logs" run: "mkdir -p build/logs" diff --git a/README.md b/README.md index 1b671ac2..b7e617c3 100644 --- a/README.md +++ b/README.md @@ -50,15 +50,17 @@ That's why I made this fork: Add the lib using [Composer](https://getcomposer.org/): - composer require j0k3r/graby php-http/guzzle6-adapter + composer require j0k3r/graby php-http/guzzle7-adapter -Why `php-http/guzzle6-adapter`? Because Graby is decoupled from any HTTP client implementation, thanks to [HTTPlug](http://httplug.io/) (see [that list of client implementation](https://packagist.org/providers/php-http/client-implementation)). +Why `php-http/guzzle7-adapter`? Because Graby is decoupled from any HTTP client implementation, thanks to [HTTPlug](http://httplug.io/) (see [that list of client implementation](https://packagist.org/providers/php-http/client-implementation)). Graby is tested & should work great with: -- Guzzle 6 (using `php-http/guzzle6-adapter`) +- Guzzle 7 (using `php-http/guzzle7-adapter`) - Guzzle 5 (using `php-http/guzzle5-adapter`) -- cURL (using `php-http/curl-client` and a PSR-17 response factory [from this list](https://packagist.org/providers/psr/http-factory-implementation)) +- cURL (using `php-http/curl-client`) + +Note: if you want to use Guzzle 6, use Graby 2 (support has dropped in v3 because of dependencies conflicts, which does not happen with Guzzle 5 :shrug:) ### Retrieve content from an url @@ -196,12 +198,12 @@ configure it and inject it to `Graby\Graby`. $graby = new Graby([], new GuzzleAdapter($guzzle)); ``` -- For Guzzle 6: +- For Guzzle 7: ```php use Graby\Graby; use GuzzleHttp\Client as GuzzleClient; - use Http\Adapter\Guzzle6\Client as GuzzleAdapter; + use Http\Adapter\Guzzle7\Client as GuzzleAdapter; $guzzle = new GuzzleClient([ 'timeout' => 2,