Skip to content

Commit 64605f2

Browse files
committed
Merge pull request laravel#706 from Vespakoen/patch-1
(profiler doesn't show up) laravel.done event doesn't get fired for php-fcgi users
2 parents a95b5eb + 276f96a commit 64605f2

File tree

3 files changed

+56
-2
lines changed

3 files changed

+56
-2
lines changed

laravel/laravel.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,18 @@
178178
|
179179
*/
180180

181-
Event::fire('laravel.done', array($response));
181+
Event::fire('laravel.done', array($response));
182+
183+
/*
184+
|--------------------------------------------------------------------------
185+
| Finish the request for PHP-FastCGI
186+
|--------------------------------------------------------------------------
187+
|
188+
| Stopping the PHP process for PHP-FastCGI users to speed up some
189+
| PHP queries. Acceleration is possible when there are actions in the
190+
| process of script execution that do not affect server response.
191+
| For example, saving the session in memcached can occur after the page
192+
| has been formed and passed to a web server.
193+
*/
194+
195+
$response->foundation->finish();

laravel/response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php namespace Laravel;
22

33
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
4-
use Symfony\Component\HttpFoundation\Response as FoundationResponse;
4+
use Symfony\Component\HttpFoundation\LaravelResponse as FoundationResponse;
55

66
class Response {
77

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php namespace Symfony\Component\HttpFoundation;
2+
3+
/**
4+
* Response represents an HTTP response.
5+
*
6+
* @author Fabien Potencier <fabien@symfony.com>
7+
*
8+
* @api
9+
*/
10+
class LaravelResponse extends Response
11+
{
12+
13+
/**
14+
* Sends HTTP headers and content.
15+
*
16+
* @return Response
17+
*
18+
* @api
19+
*/
20+
public function send()
21+
{
22+
$this->sendHeaders();
23+
$this->sendContent();
24+
25+
return $this;
26+
}
27+
28+
/**
29+
* Finishes the request for PHP-FastCGI
30+
*
31+
* @return void
32+
*/
33+
public function finish()
34+
{
35+
if (function_exists('fastcgi_finish_request')) {
36+
fastcgi_finish_request();
37+
}
38+
}
39+
40+
}

0 commit comments

Comments
 (0)