Skip to content

Instantly share code, notes, and snippets.

@Majkl578
Created October 22, 2012 20:09
Show Gist options
  • Save Majkl578/3933791 to your computer and use it in GitHub Desktop.
Save Majkl578/3933791 to your computer and use it in GitHub Desktop.
BufferedTextResponse
<?php
namespace App\Application\Responses;
use Nette;
class BufferedTextResponse extends Nette\Application\Responses\TextResponse
{
public function send(Nette\Http\IRequest $httpRequest, Nette\Http\IResponse $httpResponse)
{
ob_start();
try {
parent::send($httpRequest, $httpResponse);
} catch (\Exception $e) {
ob_end_clean();
throw $e;
}
ob_end_flush();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment