Skip to content

Instantly share code, notes, and snippets.

@Crell
Created April 15, 2015 19:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Crell/ebcf65cec07dc1a17cdf to your computer and use it in GitHub Desktop.
Save Crell/ebcf65cec07dc1a17cdf to your computer and use it in GitHub Desktop.
<?php
class BigPipeResponse extends StreamedResponse {
public function __construct(Response $response) {
$this->mainResponse = $response;
$this->setStatusCode($response->statusCode());
$this->headers->set($response->headers->all());
$this->mainBody = $response->getContent();
}
public function getContent() {
return $this->mainBody;
}
public function send() {
// Send headers
// Regex the body to have everything before the </body>
// send the first part.
foreach ($subpieces as $whatever) {
// Stuff out of the patch here.
}
// print the closing </body></html>
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment