You are here

public function XHProfEventSubscriber::onKernelRequest in XHProf 8

Enables profiling if allowed.

Parameters

\Symfony\Component\HttpKernel\Event\GetResponseEvent $event: The event.

File

src/EventSubscriber/XHProfEventSubscriber.php, line 80

Class

XHProfEventSubscriber
Provides handling of start/stop for profiler.

Namespace

Drupal\xhprof\EventSubscriber

Code

public function onKernelRequest(GetResponseEvent $event) {
  if ($this->profiler
    ->canEnable($event
    ->getRequest())) {
    $this->profiler
      ->enable();
  }
}