8000 [HttpFoundation] added support for streamed responses by fabpot · Pull Request #2935 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[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
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
moved a test in the constructor
  • Loading branch information
fabpot committed Dec 21, 2011
commit 8717d4425e68949efc7b4c3c0ead69345b6fd097
8 changes: 4 additions & 4 deletions src/Symfony/Component/HttpFoundation/StreamedResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ public function __construct($callback, $status = 200, $headers = array())
parent::__construct(null, $status, $headers);

$this->callback = $callback;
if (!is_callable($this->callback)) {
throw new \LogicException('The Response callback must be a valid PHP callable.');
}

$this->streamed = false;
}

Expand Down Expand Up @@ -76,10 +80,6 @@ public function sendContent()

$this->streamed = true;

if (!is_callable($this->callback)) {
throw new \LogicException('The Response callback is not a valid PHP callable.');
}

call_user_func($this->callback);
}

Expand Down
0