8

I'm trying to run LaunchDarkly and within the code it says that I need to initialize my class like so

$client = new LDClient("MY_CLIENT_KEY"); 

Now I was able to do that but an error occured below is the error

enter image description here

The error is within this code $stack = HandlerStack::create(); inisde the GuzzleFeatureRequester.php. Its trying to call

use GuzzleHttp\HandlerStack; 

but this class does not exist when searching. Any idea on how to fix this? I'm using this on my composer.json

"guzzlehttp/guzzle": "~5.3.0", "launchdarkly/launchdarkly-php": "^2.0" 
3
  • That's an old version of Guzzle. Consider giving 6.2.2 a try? Commented Feb 2, 2017 at 5:47
  • @Ohgodwhy maybe this is not an option as the system is already using this old version and a lot of changes has been made on guzzle 6. If we switch to the latest version a lot of module will break Commented Feb 2, 2017 at 6:12
  • If it's help to anyone down the line: my issue was trying to use the Http Laravel request helper without having installed guzzle Commented Nov 2, 2021 at 20:55

2 Answers 2

8

Have you looked at the dependency of the launchdarkly-php?

It uses guzzlehttp v6.

Want the proof it's over here:

Just have a look at the composer.json over here:

https://github.com/launchdarkly/php-client/blob/master/composer.json#L22

"guzzlehttp/guzzle": "^6.2.1",

And since you are working on guzzle v5 there is no any class that you have specified.

So, if you are trying to work on launchdarkly v2 sdk try to upgrade to guzzlehttp v6.

Else as you mentioned that there is more dependency with guzzlehttp v5 then you need to use:

"launchdarkly/launchdarkly-php": "0.7.0" 

Hope this helps you.

Sign up to request clarification or add additional context in comments.

1 Comment

Great then I have no other choice then.. Thanks for the reply
0

your laravel version should be compatible with guzzle versions

Laravel 5.8: Guzzle ^6.0 (https://github.com/laravel/framework/blob/v5.8.38/composer.json#L124) Laravel 6: Guzzle ^6.3.1|^7.0.1(https://github.com/laravel/framework/blob/v6.20.2/composer.json#L126) Laravel 7: Guzzle ^6.3.1|^7.0.1 (https://github.com/laravel/framework/blob/v7.29.2/composer.json#L132) Laravel 8: Guzzle ^6.5.5|^7.0.1 (https://github.com/laravel/framework/blob/v8.12.3/composer.json#L135)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.