Skip to content
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

Encoding #5

Merged
merged 7 commits into from Dec 24, 2015
Merged

Encoding #5

merged 7 commits into from Dec 24, 2015

Conversation

sagikazarmark
Copy link
Member

@sagikazarmark sagikazarmark added this to the v0.1 milestone Dec 20, 2015
@@ -22,6 +22,8 @@ branches:
- /^analysis-.*$/

matrix:
allow_failures:
- php: hhvm
Copy link
Contributor

Choose a reason for hiding this comment

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

we could try to detect hhvm and trigger a skip just for the tests that don't work with hhvm rather than ignore hhvm issues over the whole 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.

Good point.

@@ -18,6 +18,8 @@
"require-dev": {
"zendframework/zend-diactoros": "^1.0",
"guzzlehttp/psr7": "^1.0",
"ext-zlib": "*",
"clue/stream-filter": "^1.3",
Copy link
Member

Choose a reason for hiding this comment

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

It should be in the require part, otherwise encoding does not work

Copy link
Member Author

Choose a reason for hiding this comment

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

Please see #8

Copy link
Contributor

Choose a reason for hiding this comment

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

lets add these to suggest, and explain for what case one would want to use them in a project.


public function getReadFilter()
{
return 'zlib.deflate';
Copy link
Member Author

Choose a reason for hiding this comment

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

Should we throw an exception when zlib is not found, but this stream is being used?

Copy link
Contributor

Choose a reason for hiding this comment

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

good idea. with the optional dependency, this will at least explain what is going on. the exception message should say that you need the ext.zlib in your project if you want to use this.

@sagikazarmark
Copy link
Member Author

I had to add ignore platform deps hack to the build. As soon as we drop 5.4, it can be removed.

@sagikazarmark
Copy link
Member Author

I think this is ready to be merged.

@@ -25,7 +24,9 @@ matrix:
fast_finish: true
include:
- php: 5.4
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci"
env: COMPOSER_FLAGS="--ignore-platform-reqs"
Copy link
Contributor

Choose a reason for hiding this comment

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

is this because of the stream-filter library? if so i would move it to require-dev and suggest. if we support php 5.4, we should not fail with weird errors or tell people to ignore the platform and then they are surprised when trying to use streams.

for travis, we will need to keep the flag, as we do need the dev dependencies.

Copy link
Member Author

Choose a reason for hiding this comment

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

No, it is required for php-mock, which I used to mock extension_loaded function to test exceptions thrown.

@sagikazarmark
Copy link
Member Author

Replaced the php-mock dependency with a custom solution.

{
public function __construct(StreamInterface $stream, $level = -1)
{
parent::__construct($stream, ['window' => -15], ['window' => -15, 'level' => $level]);
Copy link
Contributor

Choose a reason for hiding this comment

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

does this not need a check for zlib as well?

@dbu
Copy link
Contributor

dbu commented Dec 24, 2015

apart from the zlib check on InflateStream, this looks ready to merge. not sure if you want to squash the commits or not.

Add stream behavior

Improve zlib tests

Remove php-mock dependency

Add zlib extension check to InflateStream
@sagikazarmark
Copy link
Member Author

No squashing is needed IMO as these commits rather make sense to be preserved. I squashed some which were related to the zlib check.

sagikazarmark added a commit that referenced this pull request Dec 24, 2015
@sagikazarmark sagikazarmark merged commit dbbded3 into master Dec 24, 2015
@sagikazarmark sagikazarmark deleted the encoding branch December 24, 2015 19:36
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.

None yet

3 participants