-
-
Notifications
You must be signed in to change notification settings - Fork 88
PHP 5.6: Remove raw body callback, php://input is seekable now #71
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
|
👎 The previous implementation was cleaner. |
|
Cleaner in what way? It just always directly called |
|
|
|
Agree, current implementation is easier to mock. |
|
I agree that it should not read global state. But current implementation is just a hack because I also had another solution in mind, except obvious option to introduce an interface (sounds unnecessary), an option to provide a stream address |
Nope. I wrote the current implementation and the callback is here because "Request should not read global state". The hack was there before the callback.
Which noone really cares about, this is PHP. |
|
If you don't care about constructor, why not just pass |
|
That was considered, but doing so in PHP < 5.6 is AFAIK very difficult to do reliably and efficiently. Doing so now is an unnecessary BC break for no clear gain. |
|
Sure, it would be a little BC break (funny, considering all the PHP 5.6/7.0 changes that are coming), but as you said, for a low level class where almost noone cares about the constructor. |
|
But what would we gain with such BC break? Support for processing large post bodies? Maybe. Assuming there is no performance penalty for passing |
|
Implemented in this way 0f5cee3 |
BC break (deprecation of
$rawBodyCallbackin constructor)I'd also remove NULL on empty data and return empty string, but I'm not sure about implications in user-land...
Depends on #70 (composer.json & Travis).