From 52fded661d6c1a2faafffe8374f7771f8b351400 Mon Sep 17 00:00:00 2001 From: Koen Schmeets Date: Thu, 24 May 2012 11:50:48 +0200 Subject: [PATCH] Extending Symfony's Response class and adding & calling the finish method Signed-off-by: Koen Schmeets --- laravel/laravel.php | 4 +- laravel/response.php | 2 +- .../HttpFoundation/LaravelResponse.php | 40 +++++++++++++++++++ 3 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 laravel/vendor/Symfony/Component/HttpFoundation/LaravelResponse.php diff --git a/laravel/laravel.php b/laravel/laravel.php index c3fef2ee..fcdc32c5 100644 --- a/laravel/laravel.php +++ b/laravel/laravel.php @@ -180,6 +180,4 @@ Event::fire('laravel.done', array($response)); -if (function_exists('fastcgi_finish_request')) { - fastcgi_finish_request(); -} \ No newline at end of file +$response->finish(); \ No newline at end of file diff --git a/laravel/response.php b/laravel/response.php index e5472430..539f5649 100644 --- a/laravel/response.php +++ b/laravel/response.php @@ -1,7 +1,7 @@ + * + * @api + */ +class LaravelResponse extends Response +{ + + /** + * Sends HTTP headers and content. + * + * @return Response + * + * @api + */ + public function send() + { + $this->sendHeaders(); + $this->sendContent(); + + return $this; + } + + /** + * Finishes the request for PHP-FastCGI + * + * @return void + */ + public function finish() + { + if (function_exists('fastcgi_finish_request')) { + fastcgi_finish_request(); + } + } + +}