You are here

class XhprofServiceProvider in XHProf 8

Defines a service profiler for the xhprof module.

Hierarchy

Expanded class hierarchy of XhprofServiceProvider

File

src/XhprofServiceProvider.php, line 14

Namespace

Drupal\xhprof
View source
class XhprofServiceProvider extends ServiceProviderBase {

  /**
   * {@inheritdoc}
   */
  public function register(ContainerBuilder $container) {
    $container
      ->addCompilerPass(new StoragePass());
    if (FALSE !== $container
      ->hasDefinition('profiler')) {
      $container
        ->register('webprofiler.xhprof', XHProfDataCollector::class)
        ->addArgument(new Reference('xhprof.profiler'))
        ->addTag('data_collector', [
        'template' => '@xhprof/Collector/xhprof.html.twig',
        'id' => 'xhprof',
        'title' => 'XHProf',
        'priority' => 50,
      ]);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ServiceProviderBase::alter public function Modifies existing service definitions. Overrides ServiceModifierInterface::alter 5
XhprofServiceProvider::register public function Registers services to the container. Overrides ServiceProviderBase::register