tehplague / swiftmailer-mailgun-bundle

Swiftmailer Mailgun transport as a Symfony bundle
104 stars 49 forks source link

can't use guzzle #78

Open tacman opened 5 years ago

tacman commented 5 years ago

With a very basic symfony app (based on the Symfony4.2 demo, all started plugins), I'm having difficult configuring the bundle.

I can install it, but can't install an adapter. The problem is httplug version, needs to allow version 2.


In HttpClientDiscovery.php line 27:

  No HTTPlug clients found. Make sure to install a package providing "php-http/client-implementation". Example: "php-http/guzzle6-adapter".  

In DiscoveryFailedException.php line 41:

  Could not find resource using any discovery strategy. Find more information at http://docs.php-http.org/en/latest/discovery.html#common-errors                                                                                                           
   - Puli Factory is not available                                                                                                                                                                                                                         
   - No valid candidate found using strategy "Http\Discovery\Strategy\CommonClassesStrategy". We tested the following candidates: Http\Adapter\Guzzle6\Client, Http\Adapter\Guzzle5\Client, Http\Client\Curl\Client, Http\Client\Socket\Client, Http\Adap  
  ter\Buzz\Client, Http\Adapter\React\Client, Http\Adapter\Cake\Client, Http\Adapter\Zend\Client, Http\Adapter\Artax\Client, Http\Discovery\Strategy\CommonClassesStrategy::buzzInstantiate.                                                               
   - No valid candidate found using strategy "Http\Discovery\Strategy\CommonPsr17ClassesStrategy". We tested the following candidates: .                                                                                                                   

swiftmailer:email:send [--from FROM] [--to TO] [--subject SUBJECT] [--body BODY] [--mailer MAILER] [--content-type CONTENT-TYPE] [--charset CHARSET] [--body-source BODY-SOURCE] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>

tac@wild-dog:~/rappnet$ composer require php-http/guzzle6-adapter
Using version ^2.0 for php-http/guzzle6-adapter
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.2.*"
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install php-http/guzzle6-adapter v2.0.1
    - Conclusion: don't install php-http/guzzle6-adapter v2.0.0
    - Conclusion: remove php-http/httplug v1.1.0
    - Installation request for php-http/guzzle6-adapter ^2.0 -> satisfiable by php-http/guzzle6-adapter[2.x-dev, v2.0.0, v2.0.1].
    - Conclusion: don't install php-http/httplug v1.1.0
    - php-http/guzzle6-adapter 2.x-dev requires php-http/httplug ^2.0 -> satisfiable by php-http/httplug[2.0.x-dev, v2.0.0].
    - Can only install one of: php-http/httplug[2.0.x-dev, v1.1.0].
    - Can only install one of: php-http/httplug[v2.0.0, v1.1.0].
    - Installation request for php-http/httplug (locked at v1.1.0) -> satisfiable by php-http/httplug[v1.1.0].

Installation failed, reverting ./composer.json to its original content.

depends [-r|--recursive] [-t|--tree] [--] <package> [<constraint>]

tac@wild-dog:~/rappnet$ composer why php-http/httplug
mailgun/mailgun-php     2.6.0  requires  php-http/httplug (^1.0)  
php-http/client-common  1.9.0  requires  php-http/httplug (^1.1)  
tacman commented 5 years ago

I was able to install guzzle6 with composer req php-http/guzzle6-adapter ^1, but better would be the ability to install it by default, with composer require php-http/guzzle6-adapter

nicodemuz commented 5 years ago

The following worked for me:

composer require cspoo/swiftmailer-mailgun-bundle
composer require php-http/httplug-pack 1.1