-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Output buffer middleware #2166
Output buffer middleware #2166
Conversation
Changes so far include:
|
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.
Need tests for the newOutputBuffering
middleware- Can you add a CHANGELOG entry please?
Update - I can't read!
@@ -296,36 +276,11 @@ public function testInvokeWhenEchoingOutput() | |||
public function testInvokeWhenReturningAString() |
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 think this test should return a string and expect an Exception to happen?
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.
@akrabat I think the name of the test should change. This test should be renamed.
testEchoingOutputIsEmpty
testReturningStringThrowsException
?
// TODO: Do we keep output buffering? | ||
if (is_callable([$route, 'setOutputBuffering'])) { | ||
$route->setOutputBuffering($this->getSetting('outputBuffering', 'append')); | ||
} |
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 honestly think that we can remove it.
Dump and Die will still work, which is I feel what a majority of people do anyway.
@@ -296,36 +276,11 @@ public function testInvokeWhenEchoingOutput() | |||
public function testInvokeWhenReturningAString() |
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.
@akrabat I think the name of the test should change. This test should be renamed.
testEchoingOutputIsEmpty
testReturningStringThrowsException
?
ob_start(); | ||
$newResponse = $next($req, $res); | ||
$output = ob_get_clean(); | ||
} catch (\Throwable $e) { |
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.
PHP 5 vs PHP 7 #2175
Work in progress. Opening PR for feedback.