diff --git a/laravel/laravel.php b/laravel/laravel.php index a1ca20615f0..542c945d447 100644 --- a/laravel/laravel.php +++ b/laravel/laravel.php @@ -178,4 +178,18 @@ | */ -Event::fire('laravel.done', array($response)); \ No newline at end of file +Event::fire('laravel.done', array($response)); + +/* +|-------------------------------------------------------------------------- +| Finish the request for PHP-FastCGI +|-------------------------------------------------------------------------- +| +| Stopping the PHP process for PHP-FastCGI users to speed up some +| PHP queries. Acceleration is possible when there are actions in the +| process of script execution that do not affect server response. +| For example, saving the session in memcached can occur after the page +| has been formed and passed to a web server. +*/ + +$response->foundation->finish(); \ No newline at end of file diff --git a/laravel/response.php b/laravel/response.php index e5472430e88..539f5649764 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(); + } + } + +}