Created
October 22, 2012 20:09
-
-
Save Majkl578/3933791 to your computer and use it in GitHub Desktop.
BufferedTextResponse
This file contains 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 | |
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