當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。