Created
December 30, 2015 10:08
-
-
Save romainneutron/35aa9447e106b99e37c9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Symfony\Component\HttpFoundation\Request; | |
$loader = require __DIR__.'/../app/autoload.php'; | |
include_once __DIR__.'/../app/bootstrap.php.cache'; | |
$kernel = new AppKernel('prod', false); | |
$kernel->loadClassCache(); | |
$request = Request::createFromGlobals(); | |
// Only if a profile is requested, let's enable the probe | |
if (isset($_SERVER['HTTP_X_BLACKFIRE_QUERY'])) { | |
$probe = BlackfireProbe::getMainInstance(); | |
$probe->enable(); | |
} | |
$response = $kernel->handle($request); | |
// let's only profile kernel::handle | |
if (isset($probe)) { | |
$probe->close(); | |
} | |
$response->send(); | |
$kernel->terminate($request, $response); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment