当前位置: 首页>>代码示例>>PHP>>正文


PHP ContainerBuilder::addCompilerPass方法代码示例

本文整理汇总了PHP中Drupal\Core\DependencyInjection\ContainerBuilder::addCompilerPass方法的典型用法代码示例。如果您正苦于以下问题:PHP ContainerBuilder::addCompilerPass方法的具体用法?PHP ContainerBuilder::addCompilerPass怎么用?PHP ContainerBuilder::addCompilerPass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Drupal\Core\DependencyInjection\ContainerBuilder的用法示例。


在下文中一共展示了ContainerBuilder::addCompilerPass方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: register

 /**
  * {@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());
 }
开发者ID:318io,项目名称:318-io,代码行数:10,代码来源:SerializationServiceProvider.php

示例2: alter

 /**
  * @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'));
 }
开发者ID:jibran,项目名称:drush,代码行数:12,代码来源:DrushServiceModfier.php

示例3: register

 /**
  * {@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));
     }
 }
开发者ID:shahinam,项目名称:drupal8devel,代码行数:10,代码来源:XhprofServiceProvider.php

示例4: register

 /**
  * {@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]);
     }
 }
开发者ID:ABaldwinHunter,项目名称:durhamatletico-cms,代码行数:25,代码来源:WebprofilerServiceProvider.php

示例5: alter

 /**
  * @inheritdoc
  */
 public function alter(ContainerBuilder $container)
 {
     $container->addCompilerPass(new AddCommandsCompilerPass($this->consoleRoot));
     $container->addCompilerPass(new FindCommandsCompilerPass($this->serviceTag));
 }
开发者ID:blauerberg,项目名称:DrupalConsole,代码行数:8,代码来源:DrupalServiceModifier.php

示例6: register

 /**
  * {@inheritdoc}
  */
 public function register(ContainerBuilder $container)
 {
     $container->addCompilerPass(new NgLightboxPass());
 }
开发者ID:318io,项目名称:318-io,代码行数:7,代码来源:NgLightboxServiceProvider.php

示例7: alter

 /**
  * @inheritdoc
  */
 public function alter(ContainerBuilder $container)
 {
     $container->addCompilerPass(new AddServicesCompilerPass($this->root));
     $container->addCompilerPass(new FindCommandsCompilerPass($this->commandTag));
     $container->addCompilerPass(new FindGeneratorsCompilerPass($this->generatorTag));
 }
开发者ID:ibonelli,项目名称:DrupalConsole,代码行数:9,代码来源:DrupalServiceModifier.php


注:本文中的Drupal\Core\DependencyInjection\ContainerBuilder::addCompilerPass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。