Extending Symfony's Response class and adding & calling the finish method
Signed-off-by: Koen Schmeets <k.schmeets@gmail.com>
This commit is contained in:
parent
0f3e8eb62b
commit
52fded661d
|
@ -180,6 +180,4 @@
|
||||||
|
|
||||||
Event::fire('laravel.done', array($response));
|
Event::fire('laravel.done', array($response));
|
||||||
|
|
||||||
if (function_exists('fastcgi_finish_request')) {
|
$response->finish();
|
||||||
fastcgi_finish_request();
|
|
||||||
}
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php namespace Laravel;
|
<?php namespace Laravel;
|
||||||
|
|
||||||
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
|
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
|
||||||
use Symfony\Component\HttpFoundation\Response as FoundationResponse;
|
use Symfony\Component\HttpFoundation\LaravelResponse as FoundationResponse;
|
||||||
|
|
||||||
class Response {
|
class Response {
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
<?php namespace Symfony\Component\HttpFoundation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Response represents an HTTP response.
|
||||||
|
*
|
||||||
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* @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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue