Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Class 'GuzzleHttp\HandlerStack' not found

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"
like image 714
MadzQuestioning Avatar asked Feb 02 '17 05:02

MadzQuestioning


1 Answers

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.

like image 107
PaladiN Avatar answered Sep 19 '22 22:09

PaladiN