ricbra / php-discogs-api

PHP 5.4 Implementation of the Discogs API
MIT License
152 stars 95 forks source link

'GuzzleHttp\Client' #46

Closed Sandeeppixatra closed 6 years ago

Sandeeppixatra commented 7 years ago

Fatal error: Class 'GuzzleHttp\Client' not found in /home1/dnguah/public_html/instgram/php-discogs-api/lib/Discogs/ClientFactory.php on line 24

2crazyzgb commented 7 years ago

Hi, I had same error and I manually add in comoser.json this lines "guzzlehttp/guzzle": "~5.0", "guzzlehttp/guzzle-services": "~0.5.0", "guzzlehttp/oauth-subscriber": "~0.2"

froschdesign commented 7 years ago

@Sandeeppixatra Use Composer to install the "Discogs Api" library and all dependencies are automatically installed.

@2crazyzgb These entries are already there:

"require": {
    "php": ">=5.4.0",
    "guzzlehttp/guzzle": "~5.0",
    "guzzlehttp/guzzle-services": "~0.5.0",
    "guzzlehttp/oauth-subscriber": "~0.2"
},

https://github.com/ricbra/php-discogs-api/blob/master/composer.json#L9

pierre-dickinson commented 6 years ago

Hi, would it be possible for you to upgrade your Guzzle version and use the same guzzle package as the one use in Goutte php ? https://github.com/FriendsOfPHP/Goutte

if i use your package i get this fatal error:

Fatal error: Call to undefined method GuzzleHttp\Client::request() with Guzzle

here is the composer require info for the latest guzzle:

        "php": ">=5.5",
        "guzzlehttp/psr7": "^1.4",
        "guzzlehttp/promises": "^1.0"

Thanks

froschdesign commented 6 years ago

@mecanographik

here is the composer require info for the latest guzzle:

"php": ">=5.5",
"guzzlehttp/psr7": "^1.4",
"guzzlehttp/promises": "^1.0"

Sorry, these are the wrong requirements! You need Guzzle with version 6 if you want to use the request method. ("guzzlehttp/guzzle": "^6.0") Before version 6 it was the method createRequest. See: http://docs.guzzlephp.org/en/5.3/quickstart.html#creating-a-client

pierre-dickinson commented 6 years ago

ok thanks, but do you think that the php-discogs-api package will work with those new class names, etc? i can't find a working php 7 fork ... 🤦🏻‍♂️

froschdesign commented 6 years ago

@mecanographik The current version of this package runs with PHP 7. Your problem is the conflict with the Guzzle version which is used by Goutte:

My suggestion: you should create a new issue report and ask for an update of the Guzzle support.

@ricbra I think this issue can be closed. The current question has been answered.

ricbra commented 6 years ago

Allright, closing this.