I'm trying to update to Guzzle 6 and in the changelog you have this:
Static functions in GuzzleHttp\Utils have been moved to namespaced functions under the GuzzleHttp namespace. This requires either a Composer based autoloader or you to include functions.php.
Now I have tried different ways of autoloading the functions but I'm getting different errors. What is the proper way of autoloading the functions on composer.json
I have added this to my composer.json:
"autoload": {
"files": ["vendor/guzzlehttp/guzzle/src/functions.php"]
}
Then after that I get an error:
PHP Fatal error: Cannot redeclare GuzzleHttp\uri_template() (previously declared in /home/fabio/flubit/dm/vendor/guzzlehttp/guzzle/src/functions.php:18) in /home/fabio/flubit/dm/vendor/guzzlehttp/guzzle/src/functions.php on line 32
So obviously I'm trying to load something that's already being loaded.
So I removed the autoload from composer and then try to use the json_decode()built in function on Guzzle doing this \GuzzleHttp\json_decode() I get this:
PHP Fatal error: Call to undefined function GuzzleHttp\json_decode()
composer.json(Guzzle already gets loaded automatically, you're probably double-loading it) and if that doesn't fix it b) remove the entirevendor/directory and do a freshcomposer install. Also, Guzzle doesn't have ajson_decodefunction - PHP does.\GuzzleHttp\json_decode()won't ever work. - ceejayoz