Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

The Guzzle 7 is complaining about the stream_for method. #143

Merged
merged 1 commit into from
Jul 2, 2021
Merged

The Guzzle 7 is complaining about the stream_for method. #143

merged 1 commit into from
Jul 2, 2021

Conversation

dbclkh
Copy link
Contributor

@dbclkh dbclkh commented Jul 2, 2021

The Guzzle 7 is complaining about the stream_for method. It is deprecated and they want to use Utils::streamFor instead

…ated and they want to use Utils::streamFor instead
@Kevinrob Kevinrob merged commit 3dc6830 into Kevinrob:master Jul 2, 2021
@m4olivei
Copy link

I picked up a failure in my test suite after this change. I think the change is fine, only you need to reflect it in your dependencies as well. The \GuzzleHttp\Psr7\Utils was introduced in guzzlehttp/psr7:1.7.0. The version constraints on this repo allow guzzlehttp/guzzle:"^6.0 || ^7.0". Guzzle 6 requires guzzlehttp/psr7: ^1.6.1, so in the end if your using Guzzle 6, you could end up with guzzlehttp/psr7:1.6.1 (which was the case for me) and then 💥 errors like this:

Error: Class 'GuzzleHttp\Psr7\Utils' not found

/var/www/html/vendor/kevinrob/guzzle-cache-middleware/src/CacheEntry.php:283
/var/www/html/core/lib/Drupal/Core/Cache/MemoryBackend.php:87
/var/www/html/core/lib/Drupal/Core/Cache/MemoryBackend.php:34
/var/www/html/modules/contrib/guzzle_cache/src/DrupalGuzzleCache.php:86
/var/www/html/modules/*********/src/MpxCacheStrategy.php:78
/var/www/html/vendor/kevinrob/guzzle-cache-middleware/src/Strategy/Delegate/DelegatingCacheStrategy.php:75
/var/www/html/vendor/kevinrob/guzzle-cache-middleware/src/CacheMiddleware.php:142

Note: Stack trace trimmed for brevity.

Ultimately I went back to using version 3.3.1 of kevinrob/guzzle-cache-middleware to fix my issue (since I have no control ATM over Guzzle version in user).

I think guzzlehttp/psr7 should be required here as ^1.7.0 to fix these types of errors on 3.4.

@Kevinrob
Copy link
Owner

You are right @m4olivei .
I added a constraint in 0e4dfb4 and released a new version v3.4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants