Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[HttpFoundation] added support for streamed responses #2935

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 5 commits into from
Dec 31, 2011
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
made some cosmetic changes
  • Loading branch information
fabpot committed Dec 21, 2011
commit e44b8ba521e60f4b0c8218a65415c001090520da
6 changes: 3 additions & 3 deletions 6 src/Symfony/Bundle/FrameworkBundle/HttpKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ public function render($controller, array $options = array())
throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %s).', $request->getUri(), $response->getStatusCode()));
}

if ($response instanceof StreamedResponse) {
$response->sendContent();
} else {
if (!$response instanceof StreamedResponse) {
return $response->getContent();
}

$response->sendContent();
} catch (\Exception $e) {
if ($options['alt']) {
$alt = $options['alt'];
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/HttpFoundation/StreamedResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* StreamedResponse represents a streamed HTTP response.
*
* A StreamedResponse uses a callback for its the content.
* A StreamedResponse uses a callback for its content.
*
* The callback should use the standard PHP functions like echo
* to stream the response back to the client. The flush() method
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/Templating/EngineInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function render($name, array $parameters = array());
/**
* Streams a template.
*
* The implementation should outputs the content directly to the client.
* The implementation should output the content directly to the client.
*
* @param mixed $name A template name or a TemplateReferenceInterface instance
* @param array $parameters An array of parameters to pass to the template
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ public function testSetContent()
public function testGetContent()
{
$response = new StreamedResponse(function () { echo 'foo'; });
$this->assertEquals(false, $response->getContent());
$this->assertFalse($response->getContent());
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.