Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function register(ContainerBuilder $container)
 {
     // Add a compiler pass for adding Normalizers and Encoders to Serializer.
     $container->addCompilerPass(new RegisterSerializationClassesCompilerPass());
     // Add a compiler pass for adding concrete Resolvers to chain Resolver.
     $container->addCompilerPass(new RegisterEntityResolversCompilerPass());
 }
Пример #2
0
 /**
  * @inheritdoc
  */
 public function alter(ContainerBuilder $container)
 {
     drush_log(dt("service modifier alter"), LogLevel::DEBUG);
     // http://symfony.com/doc/2.7/components/dependency_injection/tags.html#register-the-pass-with-the-container
     $container->register('drush.service.consolecommands', 'Drush\\Command\\ServiceCommandlist');
     $container->addCompilerPass(new FindCommandsCompilerPass('drush.service.consolecommands', 'console.command'));
     $container->register('drush.service.consolidationcommands', 'Drush\\Command\\ServiceCommandlist');
     $container->addCompilerPass(new FindCommandsCompilerPass('drush.service.consolidationcommands', 'consolidation.commandhandler'));
 }
 /**
  * {@inheritdoc}
  */
 public function register(ContainerBuilder $container)
 {
     $container->addCompilerPass(new StoragePass());
     if (FALSE !== $container->hasDefinition('profiler')) {
         $container->register('webprofiler.xhprof', 'Drupal\\xhprof\\DataCollector\\XHProfDataCollector')->addArgument(new Reference('xhprof.profiler'))->addTag('data_collector', array('template' => '@xhprof/Collector/xhprof.html.twig', 'id' => 'xhprof', 'title' => 'XHProf', 'priority' => 50));
     }
 }
 /**
  * {@inheritdoc}
  */
 public function register(ContainerBuilder $container)
 {
     // Add a compiler pass to discover all data collector services.
     $container->addCompilerPass(new ProfilerPass());
     // Add a compiler pass to discover all available storage backend.
     $container->addCompilerPass(new StoragePass());
     $container->addCompilerPass(new ServicePass(), PassConfig::TYPE_AFTER_REMOVING);
     $container->addCompilerPass(new EventPass(), PassConfig::TYPE_AFTER_REMOVING);
     $modules = $container->getParameter('container.modules');
     // Add ViewsDataCollector only if Views module is enabled.
     if (isset($modules['views'])) {
         $container->register('webprofiler.views', 'Drupal\\webprofiler\\DataCollector\\ViewsDataCollector')->addArgument(new Reference('views.executable'))->addArgument(new Reference('entity.manager'))->addTag('data_collector', ['template' => '@webprofiler/Collector/views.html.twig', 'id' => 'views', 'title' => 'Views', 'priority' => 75]);
     }
     // Add BlockDataCollector only if Block module is enabled.
     if (isset($modules['block'])) {
         $container->register('webprofiler.blocks', 'Drupal\\webprofiler\\DataCollector\\BlocksDataCollector')->addArgument(new Reference('entity.manager'))->addTag('data_collector', ['template' => '@webprofiler/Collector/blocks.html.twig', 'id' => 'blocks', 'title' => 'Blocks', 'priority' => 78]);
     }
     // Add TranslationsDataCollector only if Locale module is enabled.
     if (isset($modules['locale'])) {
         $container->register('webprofiler.translations', 'Drupal\\webprofiler\\DataCollector\\TranslationsDataCollector')->addArgument(new Reference('string_translation'))->addArgument(new Reference('url_generator'))->addTag('data_collector', ['template' => '@webprofiler/Collector/translations.html.twig', 'id' => 'translations', 'title' => 'Translations', 'priority' => 210]);
     }
 }
 /**
  * @inheritdoc
  */
 public function alter(ContainerBuilder $container)
 {
     $container->addCompilerPass(new AddCommandsCompilerPass($this->consoleRoot));
     $container->addCompilerPass(new FindCommandsCompilerPass($this->serviceTag));
 }
Пример #6
0
 /**
  * {@inheritdoc}
  */
 public function register(ContainerBuilder $container)
 {
     $container->addCompilerPass(new NgLightboxPass());
 }
 /**
  * @inheritdoc
  */
 public function alter(ContainerBuilder $container)
 {
     $container->addCompilerPass(new AddServicesCompilerPass($this->root));
     $container->addCompilerPass(new FindCommandsCompilerPass($this->commandTag));
     $container->addCompilerPass(new FindGeneratorsCompilerPass($this->generatorTag));
 }