Skip to content

Always read size of chunksize if in MemoryStream #110

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

Merged
merged 1 commit into from
Feb 18, 2019
Merged

Conversation

joelwurtz
Copy link
Member

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets fixes #107
Documentation /
License MIT

This fix test for php 7.2 / 7.3, PHP seems now to respect fread length better since those version exists, which is misleading in our test since we try to read the default php buffer size (8192)

@joelwurtz joelwurtz mentioned this pull request Feb 17, 2019
Copy link
Contributor

@dbu dbu left a comment

Choose a reason for hiding this comment

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

good find. added a question.

public function __construct($body = "", $chunkSize = null)
private $chunkSize;

public function __construct($body = "", $chunkSize = 8192)
Copy link
Contributor

Choose a reason for hiding this comment

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

how did you determine this default? is there a way to figure out the system default instead of hardcoding it here? i guess 8kb is the norm for 64bit and 4096 for 32bit?

Copy link
Member Author

Choose a reason for hiding this comment

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

Default value is the BUFSIZ C constant which depends on the compiler used, and there is no way to get it here.

When reading various streaming PHP librairies, 8192 was a widely value used for buffer, so decided to keep here.

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for the explanation!
oh this is the spec and not the source. sorry i asked, for a test we don't need to overthink it anyways.

@dbu dbu merged commit 9c151ed into master Feb 18, 2019
@dbu dbu deleted the feature/fix-test-php72 branch February 18, 2019 16:33
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.

2 participants