Unabled to install through composer anymore.
Package egeloen/http-adapter is abandoned, you should avoid using it. Use php-http/httplug instead
willdurand/geocoder deprecated egeloen/ivory-http-adapter
This is the corresponding work to keep up with changes.
SEE
#512 Implement Httplug
https://github.com/geocoder-php/Geocoder/pull/512
https://github.com/geocoder-php/Geocoder/commit/9ea2bcbf70cee0d469b67b95...
I tried to install Geocoder module (I didn't install Composer Manager, but I did install Service Container) on D8.1.7
after Composer update, then I tried to save a content. The error below is thrown:
Error: Class 'Ivory\HttpAdapter\CurlHttpAdapter' not found in Drupal\Component\DependencyInjection\Container->createService() (line 264 of /srv/www/joinsure.insready.com/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php).
Comment | File | Size | Author |
---|---|---|---|
#11 | use-httplug-2772541-11.patch | 2.14 KB | chriscalip |
#6 | 2772541-6-geocoder-fix-missing-class.patch | 974 bytes | chriscalip |
#3 | 2772541-3-geocoder-fix-missing-class.patch | 973 bytes | chriscalip |
Comments
Comment #2
chriscalip CreditAttribution: chriscalip commentedError sighting confirmed!
For anyone encountering this error do this :
Comment #3
chriscalip CreditAttribution: chriscalip commentedRight so the problem is that geocoder module requires egeloen/http-adapter library,
the simple solution is :
But we also need to include on the docs and hook_requirements routine.
Here's the patch to include on README.txt and requirements routine.
I believe this fix is a maintainer judgement call because the composer best practices has not fully agreed upon by our community. Should we make use of composer_manager ? Should we offload this work to contrib maintainers doing the hook_requirements labor ? etc..
I am just trying to move this issue forward. As it is this fix draws inspiration by the d8 address module composer practices:
- adding readme.txt library information in the powered by section
- adding hook_requirements routine .
patched attached.
Comment #4
chriscalip CreditAttribution: chriscalip commentedWell more complication on this issue; according to required library documentation
per link :
https://github.com/egeloen/ivory-http-adapter
I believe the work on deprecation and replacement is another issue.
Comment #5
chriscalip CreditAttribution: chriscalip commentedComment #6
chriscalip CreditAttribution: chriscalip commentedadhere to namespace conventions.
Comment #7
PolWhy not updating the composer.json inside the module instead ?
Comment #8
PolAnd I'm wondering if this is really necessary because Geocoder PHP requires it in its own composer.json.
See: https://github.com/geocoder-php/Geocoder/blob/master/composer.json
Comment #9
PolI've updated the README.
I'll release a new alpha by the end of the day.
This issue is meaningless now.
Comment #10
chriscalip CreditAttribution: chriscalip commentedAs of today, October 04, 2016 -- This is still active even with the latest commit
http://cgit.drupalcode.org/geocoder/tree/?id=161521b
See
http://cgit.drupalcode.org/geocoder/tree/geocoder.services.yml?id=161521b
class: Ivory\HttpAdapter\CurlHttpAdapter still in play.
Comment #11
chriscalip CreditAttribution: chriscalip commentedPatched attached.
Replaces all instances of using deprecated Ivory\HttpAdapter\CurlHttpAdapter to Http\Client\HttpClient
Comment #12
chriscalip CreditAttribution: chriscalip commentedComment #13
chriscalip CreditAttribution: chriscalip commentedComment #14
chriscalip CreditAttribution: chriscalip commentedComment #15
chriscalip CreditAttribution: chriscalip commentedComment #16
chriscalip CreditAttribution: chriscalip commentedComment #17
chriscalip CreditAttribution: chriscalip commentedAt the heart of this problem is that
Only adds module to DRUPAL_ROOT/modules/geocoder and will not let us add module
in another location e.g. DRUPAL_ROOT/modules/contrib/geocoder
I am stuck in trying to manually install vendor libs manually through individually installing libraries.. but this workaround is currently blocked by egeloen/http-adapter abandonment.
Comment #18
chriscalip CreditAttribution: chriscalip commentedComment #19
chriscalip CreditAttribution: chriscalip commentedFound solution. anyone getting this problem :
On drupal root do this.
Comment #20
chriscalip CreditAttribution: chriscalip commentedComment #21
Neograph734Why has this been closed? With a clean install of this module, the issue still exists.
Since https://github.com/geocoder-php/Geocoder/pull/512 has been merged and version 4 has been released: https://github.com/geocoder-php/Geocoder/releases I think this module is good to move on.
The only thing left to do is that this module's composer.json needs to be updated to use geocoder 4.0.0:
There is however one catch... Geocoder 4 requires php: ^7.0. By using it into this module, this module would lose compatibility with php 5.x versions.
Active support for php 5.6 stopped 6 months ago (security updates will keep coming for one year), so it might be good to switch to PHP 7, but that is up to the maintainers.
Comment #22
michaelfavia CreditAttribution: michaelfavia commented@Neograph734: Please see our discussion of the PHP7 requirement here: #2825360: Support for v4.0 of willdurand/geocoder library (deprecated egeloen/http-adapter)
While I'm in favor of a 4.0 branch were hesitant to require it for very little gain because of the trouble it will cause some who cant control their environment easily.
Comment #23
chriscalip CreditAttribution: chriscalip commentedThis issue is considered closed as of 8.x-2.x
https://cgit.drupalcode.org/geocoder/tree/composer.json?h=8.x-2.x
The solution consensus for this thread is to make use of `"willdurand/geocoder": "^3.3"` which is already a requirement in 8.x-2.x
This module depends on `"willdurand/geocoder": "^3.3"` which is on php 5.4
Comment #24
itamair CreditAttribution: itamair as a volunteer commentedMight this been closed then? I guess yes ... isn't it?
The actual 8.x-2.0-beta2 version is requiring "willdurand/geocoder": "^3.3" and php 5.4 and install cleanly ...
Comment #25
PolComment #26
BEGRAFX CreditAttribution: BEGRAFX commentedSo then I added the line
"willdurand/geocoder": "^4.0"
to my composer.json file, and I get...
Suggestions?
Comment #27
itamair CreditAttribution: itamair as a volunteer commented@BEGRAFX again ... the actual geocoder release is based on willdurand/geocoder3, that holds that egeloen/http-adapter: ~0.8 dependency.
Support for willdurand/geocoder4 is in the roadmap but still not close to come ...
But, as this issue title states, Package egeloen/http-adapter is abandoned, you should avoid using it. Use php-http/httplug instead ...
Why would you still keep requiring package egeloen/http-adapter besides geocoder dependency?
Comment #28
BEGRAFX CreditAttribution: BEGRAFX commented@itamair I'm not choosing to use it. It's somehow being "chosen" by Composer or something in the process. To the contrary, I got the error/warning that launched this whole thread, and I'm trying to address/resolve the issue.
Comment #29
itamair CreditAttribution: itamair as a volunteer commentedthere is nothing left to be solved here. This is closed as "works as defined" as we already investigated all this.
You would just need to run the following:
$ composer require "drupal/geocoder"
and that's it: composer will download geocoder module with its dependencies (in correct versions).
(no need to run
composer require egeloen/http-adapter
)Comment #30
BEGRAFX CreditAttribution: BEGRAFX commentedThank you. I'll do that. I don't have anything regarding egeloen/http-adapter in my composer.json file, yet I seem to get the warning about it on various installs/updates, so I was attempting to resolve the issue. A Google search lead me to this thread. Even having added the line for geocoder that you mention, i still get
Package egeloen/http-adapter is abandoned, you should avoid using it. Use php-http/httplug instead.
As I say, there is no mention at all of this adapter in my composer.json. I'm not pointing fingers at geocoder or anything else, I'm simply trying to resolve the issue. Is there something I should add/modify to force use of php-http/httplug instead?
Comment #31
chriscalip CreditAttribution: chriscalip commentedIGNORE THIS WARNING
Package egeloen/http-adapter is abandoned, you should avoid using it. Use php-http/httplug instead.
Think about the context.
This module requires library `"willdurand/geocoder": "^3.3"` which in turn requires egeloen/http-adapter .
Sure `egeloen/http-adapter` is abandoned but for the duration of this module 2.x its still going to use `"willdurand/geocoder": "^3.3"` and subsequently `egeloen/http-adapter .`
References:
https://cgit.drupalcode.org/geocoder/tree/composer.json?h=8.x-2.x
https://github.com/geocoder-php/Geocoder/blob/3.x/composer.json
Comment #32
BEGRAFX CreditAttribution: BEGRAFX commentedI've gone so far as to install the php-http/httplug
composer require php-http/httplug-bundle php-http/curl-client guzzlehttp/psr7
and it installed fine... and then, ironically gave the same warning.
I guess, as you suggest, I'll just ignore it.
Comment #33
sealionking CreditAttribution: sealionking commentedthe same issue for many times run composer update, but ignore it make no harm.