Skip to content

(profiler doesn't show up) laravel.done event doesn't get fired for php-fcgi users #706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 13, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion laravel/laravel.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,18 @@
|
*/

Event::fire('laravel.done', array($response));
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();
2 changes: 1 addition & 1 deletion laravel/response.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php namespace Laravel;

use Symfony\Component\HttpFoundation\ResponseHeaderBag;
use Symfony\Component\HttpFoundation\Response as FoundationResponse;
use Symfony\Component\HttpFoundation\LaravelResponse as FoundationResponse;

class Response {

Expand Down
Original file line number Diff line number Diff line change
@@ -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();
}
}

}