3 namespace Drupal\webprofiler\StackMiddleware;
5 use Drupal\Core\Database\Database;
6 use Symfony\Component\HttpFoundation\Request;
7 use Symfony\Component\HttpKernel\HttpKernelInterface;
10 * Class WebprofilerMiddleware
12 class WebprofilerMiddleware implements HttpKernelInterface {
15 * The decorated kernel.
17 * @var \Symfony\Component\HttpKernel\HttpKernelInterface
19 protected $httpKernel;
22 * Constructs a WebprofilerMiddleware object.
24 * @param \Symfony\Component\HttpKernel\HttpKernelInterface $http_kernel
25 * The decorated kernel.
27 public function __construct(HttpKernelInterface $http_kernel) {
28 $this->httpKernel = $http_kernel;
34 public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = TRUE) {
35 foreach (Database::getAllConnectionInfo() as $key => $info) {
36 Database::startLog('webprofiler', $key);
38 return $this->httpKernel->handle($request, $type, $catch);