Created
April 15, 2015 19:19
-
-
Save Crell/ebcf65cec07dc1a17cdf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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