public function exportAction($token)
{
$profiler = $this->container->get('profiler');
$profiler->disable();
if (!$profile = $profiler->loadProfile($token)) {
throw new NotFoundHttpException(sprintf('Token "%s" does not exist.', $token));
}
return new Response($profiler->export($profile), 200, array(
'Content-Type' => 'text/plain',
'Content-Disposition' => 'attachment; filename= '.$token.'.txt',
));
}