-
Notifications
You must be signed in to change notification settings - Fork 6
Decoder and ContentLength plugin #9
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
Conversation
@@ -19,7 +19,7 @@ env: | |||
|
|||
matrix: | |||
allow_failures: | |||
- php: 7.0 | |||
- php: hhvm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would rather skip those tests on hhvm. and have the plugin throw an exception in the constructor if it is incompatible with hhvm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm more in the thinking of providing no support for hhvm, i really dont know anyone who is using it, and with upcoming php7 it may be even worse.
IMO I don't want to pass too many hours supporting something not used at all (and rather use them to write more things for php-http :) ).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say HHVM is not a top priority for now, but it would be nice to support it eventually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have no worries making the tests skip things around streams + hhvm. but i would like to keep the hhvm build green. at liip we do use it in some projects, for example. skipping tests should not be a big hassle. if we end up with most things not working on hhvm, we can reconsider.
this is really cool! do clients like guzzle re-implement all that inside their code? on the other hand, what will guzzle do itself in the end? not much? |
Guzzle doesn't implement this, but i think curl does (only for the transfer encoding header if my memory is good) |
Will work on hhvm implementation, aside from this, any other remarks ? or is this good to merge ? |
I haven't really followed this thread, so ask @dbu for any remarks. 👍 from me, awesome work @joelwurtz as usual. |
looks good to me. i suggest that you simply add something to the tests to skip. if it would be phpunit, it would be public function setUp()
{
if (defined('HHVM_VERSION')) {
$this->markTestSkipped();
}
} |
IIRC Akeneo has a SkipExtension for PHPSpec. |
if its too much hassle, i can add a conditional `rm` of the tests in the
.travis.yml files to simply remove the tests when running with hhvm.
|
AFAIK it uses the same logic/annotations as phpunit does. How is it too much hassle? However I checked it and it can only check existing classes/interfaces, not the PHP env. |
thats what i meant with too much hassle. if we need to find some phpspec plugins and whatnot, we can just as well do it from .travis.yml. as we agree hhvm is not top priority, we should have a simple way to skip those tests. |
I would still stick to the setUp/let method instead of some weird rm logic. 😜 |
use PhpSpec\Exception\Example\SkippingException;
//...
function let()
{
if(defined('HHVM_VERSION')) {
throw new SkippingException();
}
} |
ah, if that works then sure lets do that. why is that namespace "Example"?
|
Because tests are called "examples" in phpspec terminology:
|
7ebc921
to
adc87e0
Compare
Ok on hhvm, ready to merge ? |
e8948f3
to
3a606b9
Compare
great. can you please move hhvm out of the allowed to fail tests again? then we are good to merge. we have to remember to mention in the plugin doc that the encoding plugin does not support hhvm. |
actually, maybe you can mark the stream library as conflicting with hhvm? we have no hard dependencies on the libraries used by the plugins, so people trying to run this will notice there is a problem even if they don't read the documentation. |
Conflict means uninstallable, right? |
it means composer require / install will fail when running under hhvm, yes.
i am not suggesting to make plugin conflict with hhvm, only the stream
library joel wrote
|
test will failed then on hhvm for this, as we require this lib in dev packages, any way of avoiding that ? |
oh well. i guess that won't work. lets leave it like this then. just move hhvm out of allowed failures and then we merge this. we could remove it from require-dev and have travis run composer require if not on hhvm, but that is complicated. i guess hhvm users are used to having to check whether libraries work on hhvm... |
Encoding library can work on hhvm, just requiring implementing many filters from the php world :/ |
Decoder and ContentLength plugin
👍
|
Decoder plugin allows to decode gzip, deflate, compress or chunked body from the response
ContentLengthPlugin "sanitize" the content length header, by setting its value if possible, and if not, (like we are streaming from a process), decorate the body with a chunkstream (so it's compliant with the RFC where no content length header is set)