norkunas / onesignal-php-api

OneSignal API for PHP
MIT License
233 stars 82 forks source link

composer error "Your requirements could not be resolved to an installable set of packages" #50

Closed novinfard closed 7 years ago

novinfard commented 7 years ago

hello guys,

I can't install your library due to this error during the installation process:
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for norkunas/onesignal-php-api 1.0.x-dev -> satisfiable by norkunas/onesignal-php-api[1.0.x-dev].
    - norkunas/onesignal-php-api 1.0.x-dev requires php-http/client-implementation ^1.0 -> no matching package found.

How to solve the problem?

norkunas commented 7 years ago

Hello @novinfard, You need to install any php-http client implementation to use this library. In readme you can find that i've mentioned guzzle5 and guzzle6 adapters. Or you can choose from any other alternative listed in https://packagist.org/providers/php-http/client-implementation.

novinfard commented 7 years ago

@norkunas Thanks, It seems you need to update your composer to set one of the these at least. Otherwise, I couldn't install your package and manual installation isn't a good solution.

norkunas commented 7 years ago

This library requires any of php-http/client-implementation that's why you get that error because you didn't install any implementation before. If you'd be able to install without any implementation so api wouldn't work for you, so I don't fully understand what you mean.

novinfard commented 7 years ago

Maybe it is a bit off topic, but how composer found I have not implemented any of php-http/client-implementations? Does it check PHP extensions or stand-alone PHP libraries inside the folder I want to setup it?

norkunas commented 7 years ago

It reads your composer.json/composer.lock files to check for it

johnerck commented 7 years ago

I had this same issue when I was trying to get up and running with this library. This thread helped me figure it out. Running php composer.phar require php-http/guzzle6-adapter put things back in order and I was able to get things up and running. I agree with @novinfard that it would be ideal to get the composer meta data updated in some way so it pulls this package in automatically if needed.

norkunas commented 7 years ago

@johnerck that's not how the virtual packages works. Also composer says in the error that adapter needs to be installed to resolve the requirements, so I don't understand what part of the error is unclear.

When I'll have time I'lll update the readme to more friendly version with notes that the chosen adapter should be installed before requiring this library. For now I'll leave this issue open if others will run into this issue.