Skip to content

Commit

Permalink
Merge pull request #277 from j0k3r/feature/guzzle-7
Browse files Browse the repository at this point in the history
Drop Guzzle 6
  • Loading branch information
j0k3r authored Dec 13, 2021
2 parents 68a0ec7 + 4bf5edf commit 026abfe
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 61 deletions.
45 changes: 2 additions & 43 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -172,46 +172,6 @@ jobs:
- name: "Run PHPUnit"
run: "php vendor/bin/simple-phpunit -v"

phpunit-guzzle7:
name: "PHPUnit (PHP ${{ matrix.php }} and Guzzle 7)"
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 7"
run: |
composer remove guzzlehttp/guzzle php-http/guzzle6-adapter --dev -n
composer require php-http/guzzle7-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"
Expand Down Expand Up @@ -243,9 +203,8 @@ 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
- name: "Setup logs"
run: "mkdir -p build/logs"
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down
23 changes: 11 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.139",
"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",
Expand Down

0 comments on commit 026abfe

Please sign in to comment.