Skip to content

Instantly share code, notes, and snippets.

@romainneutron
Created December 30, 2015 10:08
Show Gist options
  • Save romainneutron/35aa9447e106b99e37c9 to your computer and use it in GitHub Desktop.
Save romainneutron/35aa9447e106b99e37c9 to your computer and use it in GitHub Desktop.
<?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