Skip to content

Implement httplug #487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed

Conversation

Baachi
Copy link
Member

@Baachi Baachi commented Jan 18, 2016

I started to integrate HTTPlug into geocoder.
Current status: Its integrated but i'm not about some implentation details. For example i don't know if we really need the php-http/discovery package because it
introduce a lot of packages for a small benefit.

Reviews and thoughts are welcome!

Fixes #484 and #480

@@ -26,6 +30,7 @@
"geoip2/geoip2": "If you are going to use the GeoIP2DatabaseProvider.",
"symfony/stopwatch": "If you want to use the TimedGeocoder"
},
"minimum-stability": "beta",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be removed, httplug is now in a stable version :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly no, because the discovery depends on puli which is in beta state currently 😢

@joelwurtz
Copy link

You should ignore the .puli directory

{
parent::__construct();

$this->adapter = $adapter;
$this->client = $client ?: HttpClientDiscovery::find();
$this->factory = $factory ?: MessageFactoryDiscovery::find();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the way we have done this for not having discovery, is to put discovery in suggest package then on the constructor we check the existence of the DiscoveryClass, if it has not been found we throw a \LogicException with a specific error which will be in our documentation for easy googling on that, here is an example :

if (null === $responseFactory && !class_exists('\Http\Discovery\MessageFactoryDiscovery')) {
    throw new \LogicException('No response factory provided and no discovery service is present to guess it, maybe you need to install php-http/discovery package?');
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about the discovery service at all, it brings many problems and puli as new dependency. Maybe we should wait for a stable release of the discovery service.

@joelwurtz
Copy link

Also CachedResponseClient can maybe be remove and use the PluginClient from php-http which provides a CachePlugin working with a PSR6 implementation.

@Baachi
Copy link
Member Author

Baachi commented Feb 1, 2016

It seems puli have a problem with hhvm and php7, because travis passes for php 5.5, 5.6 but not for php7 and hhvm.

@Baachi
Copy link
Member Author

Baachi commented Feb 22, 2016

Some notes: Currently the tests don't passes on PHP7 and HHVM because puli is sadly not compatible with that.
Also we must bump the requirement to php 5.5 because httplug needs at least php 5.5.

@Baachi Baachi changed the title [WIP] Implement httplug Implement httplug Feb 24, 2016
"php-http/mock-client": "^0.2",
"php-http/message": "^1.0",
"php-http/guzzle6-adapter": "^1.0",
"php-http/discovery": "^0.7.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use "php-http/discovery": "^0.8.0" and put that in require.

@smartpierre
Copy link

any updates ?

@Nyholm
Copy link
Member

Nyholm commented Jun 9, 2016

If there is interest from the maintainers to merge this, I will be happy to complete this PR.

@willdurand
Copy link
Member

Yes, this should be merged into the lib at some point, especially because the current http lib is deprecated now.

cc @egeloen

@Nyholm
Copy link
Member

Nyholm commented Jun 9, 2016

Great. I'll try to get some work this weekend and next week.

@Baachi I hope you do not mind that I continue your work.

@Baachi
Copy link
Member Author

Baachi commented Jun 10, 2016

Feel free to continue the work.

@Nyholm Nyholm mentioned this pull request Jun 12, 2016
@willdurand
Copy link
Member

See #512

@willdurand willdurand closed this Jun 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants