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


PHP ContainerBuilder::getExtensionConfig方法代码示例

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


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

示例1: prepend

 /**
  * {@inheritdoc}
  */
 public function prepend(ContainerBuilder $container)
 {
     $config = current($container->getExtensionConfig('oauth2_server'));
     Assertion::keyExists($config, 'token_endpoint', 'The "TokenEndpointPlugin" must be enabled to use the "JWTBearerPlugin".');
     $bundle_config = current($container->getExtensionConfig('oauth2_server'))[$this->name()];
     $this->updateJoseBundleConfigurationForVerifier($container, 'jwt_bearer_grant_type', $bundle_config);
     $this->updateJoseBundleConfigurationForDecrypter($container, 'jwt_bearer_grant_type', $bundle_config);
     $this->updateJoseBundleConfigurationForChecker($container, 'jwt_bearer_grant_type', $bundle_config);
     $this->updateJoseBundleConfigurationForJWTLoader($container, 'jwt_bearer_grant_type', $bundle_config);
 }
开发者ID:spomky-labs,项目名称:oauth2-server-bundle,代码行数:13,代码来源:JWTBearerPlugin.php

示例2: prepend

 /**
  * {@inheritdoc}
  */
 public function prepend(ContainerBuilder $container)
 {
     $config = current($container->getExtensionConfig('oauth2_server'));
     Assertion::keyExists($config, 'authorization_endpoint', 'The "AuthorizationEndpointPlugin" must be enabled to use the "ImplicitGrantTypePlugin".');
     $config = current($container->getExtensionConfig('oauth2_server'));
     if (array_key_exists('token_endpoint', $config)) {
         foreach (['access_token_manager'] as $name) {
             $config[$this->name()][$name] = $config['token_endpoint'][$name];
         }
     }
     $container->prependExtensionConfig('oauth2_server', $config);
 }
开发者ID:spomky-labs,项目名称:oauth2-server-bundle,代码行数:15,代码来源:ImplicitGrantTypePlugin.php

示例3: getConfig

 private function getConfig(ContainerBuilder $container)
 {
     $processor = new Processor();
     $configs = $container->getExtensionConfig('atom_uploader');
     $configs[] = ['mappings' => ['Atom\\Uploader\\Model\\Uploadable' => []]];
     return $processor->processConfiguration(new Configuration(), $configs);
 }
开发者ID:atom-azimov,项目名称:uploader-bundle,代码行数:7,代码来源:RegisterMappingsCompiler.php

示例4: prepend

 /**
  * @param ContainerBuilder $container
  */
 public function prepend(ContainerBuilder $container)
 {
     $config = current($container->getExtensionConfig('swarrot'));
     $provider = $config['provider'];
     $consumers = $config['consumers'];
     $container->prependExtensionConfig($this->getAlias(), array('provider' => $provider, 'consumers' => $consumers));
 }
开发者ID:Jmoati,项目名称:SwarrotBootstrapBundle,代码行数:10,代码来源:JmoatiSwarrotBootstrapExtension.php

示例5: prepend

 /**
  * {@inheritdoc}
  */
 public function prepend(ContainerBuilder $container)
 {
     $bundles = $container->getParameter('kernel.bundles');
     $configs = $container->getExtensionConfig($this->getAlias());
     $config = $this->processConfiguration(new Configuration(), $configs);
     if ($config['theme']['form']) {
         if (isset($bundles['TwigBundle'])) {
             $container->prependExtensionConfig('twig', ['form' => ['resources' => [$config['template']['form']]]]);
         } else {
             throw new InvalidConfigurationException('You need to enable Twig Bundle to theme form or set the configuration of flob_foundation.theme.form to false');
         }
     }
     if ($config['theme']['knp_menu']) {
         if (isset($bundles['TwigBundle']) && isset($bundles['KnpMenuBundle'])) {
             $container->prependExtensionConfig('knp_menu', ['twig' => ['template' => $config['template']['knp_menu']]]);
         } else {
             throw new InvalidConfigurationException('You need to enable Twig Bundle and KNP Menu Bundle to theme menu or set the configuration of flob_foundation.theme.knp_menu to false');
         }
     }
     if ($config['theme']['knp_paginator']) {
         if (isset($bundles['TwigBundle']) && isset($bundles['KnpPaginatorBundle'])) {
             $container->prependExtensionConfig('knp_paginator', ['template' => ['pagination' => $config['template']['knp_paginator']]]);
         } else {
             throw new InvalidConfigurationException('You need to enable Twig Bundle and KNP Paginator Bundle to theme pagination or set the configuration of flob_foundation.theme.knp_paginator to false');
         }
     }
     if ($config['theme']['pagerfanta']) {
         if (isset($bundles['TwigBundle']) && isset($bundles['WhiteOctoberPagerfantaBundle'])) {
             $container->prependExtensionConfig('white_october_pagerfanta', ['default_view' => $config['template']['pagerfanta']]);
         } else {
             throw new InvalidConfigurationException('You need to enable Twig Bundle and WhiteOctober Pagerfanta Bundle to theme pagination or set the configuration of flob_foundation.theme.pagerfanta to false');
         }
     }
 }
开发者ID:pink6440,项目名称:FlobFoundationBundle,代码行数:37,代码来源:FlobFoundationExtension.php

示例6: prepend

 public function prepend(ContainerBuilder $container)
 {
     $configs = $container->getExtensionConfig($this->getAlias());
     $configuration = new Configuration();
     $config = $this->processConfiguration($configuration, $configs);
     $container->setParameter(self::CONFIG_KEY . '.access_control', $config['access_control']);
 }
开发者ID:modera,项目名称:foundation,代码行数:7,代码来源:ModeraSecurityExtension.php

示例7: prepend

 /**
  * {@inheritDoc}
  */
 public function prepend(ContainerBuilder $container)
 {
     $bundles = $container->getParameter('kernel.bundles');
     $configs = $container->getExtensionConfig($this->getAlias());
     $config = $this->processSassConfiguration($this->processConfiguration(new Configuration(), $configs));
     // Configure Assetic if AsseticBundle is activated and the option
     // "braincrafted_bootstrap.auto_configure.assetic" is set to TRUE (default value).
     if (true === isset($bundles['AsseticBundle']) && true === $config['auto_configure']['assetic']) {
         $this->configureAsseticBundle($container, $config);
     }
     // Configure Twig if TwigBundle is activated and the option
     // "braincrafted_bootstrap.auto_configure.twig" is set to TRUE (default value).
     if (true === isset($bundles['TwigBundle']) && true === $config['auto_configure']['twig']) {
         $this->configureTwigBundle($container);
     }
     // Configure KnpMenu if KnpMenuBundle and TwigBundle are activated and the option
     // "braincrafted_bootstrap.auto_configure.knp_menu" is set to TRUE (default value).
     if (true === isset($bundles['TwigBundle']) && true === isset($bundles['KnpMenuBundle']) && true === $config['auto_configure']['knp_menu']) {
         $this->configureKnpMenuBundle($container);
     }
     // Configure KnpPaginiator if KnpPaginatorBundle and TwigBundle are activated and the option
     // "braincrafted_bootstrap.auto_configure.knp_paginator" is set to TRUE (default value).
     if (true === isset($bundles['TwigBundle']) && true === isset($bundles['KnpPaginatorBundle']) && true === $config['auto_configure']['knp_paginator']) {
         $this->configureKnpPaginatorBundle($container);
     }
 }
开发者ID:Yoopies,项目名称:bootstrap-bundle,代码行数:29,代码来源:BraincraftedBootstrapExtension.php

示例8: prepend

 /**
  * {@inheritdoc}
  */
 public function prepend(ContainerBuilder $container)
 {
     $config = $container->getExtensionConfig('ynlo_framework')[0];
     //enable ajax forms and assets
     $config['ajax_forms'] = true;
     $container->prependExtensionConfig('ynlo_framework', $config);
 }
开发者ID:ynloultratech,项目名称:framework,代码行数:10,代码来源:YnloModalExtension.php

示例9: prepend

 /**
  * {@inheritDoc}
  */
 public function prepend(ContainerBuilder $container)
 {
     $configs = $container->getExtensionConfig($this->getAlias());
     $config = $this->processConfiguration(new Configuration(), $configs);
     $dbalConfig = ['dbal' => ['types' => ['hstore' => 'Intaro\\HStoreBundle\\DBAL\\Types\\HStoreType'], 'mapping_types' => ['hstore' => 'hstore']], 'orm' => ['dql' => ['string_functions' => ['contains' => 'Intaro\\HStoreBundle\\DQL\\ContainsFunction', 'defined' => 'Intaro\\HStoreBundle\\DQL\\DefinedFunction', 'hstoreDifference' => 'Intaro\\HStoreBundle\\DQL\\HstoreDifferenceFunction', 'fetchval' => 'Intaro\\HStoreBundle\\DQL\\FetchvalFunction']]]];
     $container->prependExtensionConfig('doctrine', $dbalConfig);
 }
开发者ID:molaux,项目名称:hstore-bundle,代码行数:10,代码来源:IntaroHStoreExtension.php

示例10: prepend

 /**
  * @inheritDoc
  */
 public function prepend(ContainerBuilder $container)
 {
     $config = $container->getExtensionConfig($this->getAlias());
     $config = $this->processConfiguration($this->getBundleConfiguration(), $config);
     // TODO: duplicate new connection.
     $container->prependExtensionConfig('doctrine', array('orm' => array('entity_managers' => array($config['resources']['queue_message']['options']['object_manager'] => array('connection' => $config['connection'], 'mappings' => array('DoSQueueBundle' => array('type' => 'yml', 'prefix' => 'DoS\\QueueBundle\\Model', 'dir' => '%kernel.root_dir%/../vendor/liverbool/dos-queue-bundle/Resources/config/doctrine/model')), 'filters' => array('softdeleteable' => array('class' => 'Gedmo\\SoftDeleteable\\Filter\\SoftDeleteableFilter', 'enabled' => true)))))));
 }
开发者ID:liverbool,项目名称:dos-queue-bundle,代码行数:10,代码来源:DoSQueueExtension.php

示例11: prepend

 public function prepend(ContainerBuilder $container)
 {
     $bundles = $container->getParameter('kernel.bundles');
     if (isset($bundles['SonataMediaBundle'])) {
         $this->sonata_media_config = $container->getExtensionConfig('sonata_media')[0];
     }
 }
开发者ID:symbio,项目名称:orangegate4-media-bundle,代码行数:7,代码来源:SymbioOrangeGateMediaExtension.php

示例12: process

 /**
  * @param ContainerBuilder $container
  *
  * @throws \InvalidArgumentException
  */
 public function process(ContainerBuilder $container)
 {
     $config = $container->getExtensionConfig('elastica')[0];
     $jsonLdFrameLoader = $container->get('nemrod.elastica.jsonld.frame.loader.filesystem');
     $confManager = $container->getDefinition('nemrod.elastica.config_manager');
     $filiationBuilder = $container->get('nemrod.filiation.builder');
     $jsonLdFrameLoader->setFiliationBuilder($filiationBuilder);
     foreach ($config['indexes'] as $name => $index) {
         $indexName = isset($index['index_name']) ? $index['index_name'] : $name;
         foreach ($index['types'] as $typeName => $settings) {
             $jsonLdFrameLoader->setEsIndex($name);
             $frame = $jsonLdFrameLoader->load($settings['frame'], null, true, true, true);
             $type = !empty($frame['@type']) ? $frame['@type'] : $settings['type'];
             if (empty($type)) {
                 throw \Exception("You must provide a RDF Type.");
             }
             //type
             $typeId = 'nemrod.elastica.type.' . $name . '.' . $typeName;
             $indexId = 'nemrod.elastica.index.' . $name;
             $typeDef = new DefinitionDecorator('nemrod.elastica.type.abstract');
             $typeDef->replaceArgument(0, $type);
             $typeDef->setFactory(array(new Reference($indexId), 'getType'));
             $typeDef->addTag('nemrod.elastica.type', array('index' => $name, 'name' => $typeName, 'type' => $type));
             $container->setDefinition($typeId, $typeDef);
             //registering config to configManager
             $confManager->addMethodCall('setTypeConfigurationArray', array($name, $typeName, $type, $frame));
         }
     }
 }
开发者ID:conjecto,项目名称:nemrod,代码行数:34,代码来源:ElasticaFramingRegistrationPass.php

示例13: prepend

 public function prepend(ContainerBuilder $container)
 {
     $liipConfig = Yaml::parse(file_get_contents(__DIR__ . '/../Resources/config/imagine_filters.yml'));
     $container->prependExtensionConfig('liip_imagine', $liipConfig['liip_imagine']);
     $configs = $container->getExtensionConfig($this->getAlias());
     $this->processConfiguration(new Configuration(), $configs);
 }
开发者ID:VickyDeschrijver,项目名称:KunstmaanBundlesCMS,代码行数:7,代码来源:KunstmaanSeoExtension.php

示例14: getBundleConfiguration

 private function getBundleConfiguration(ContainerBuilder $container)
 {
     $configs = $container->getExtensionConfig(self::ALIAS);
     $configuration = new Configuration(self::ALIAS);
     $config = $this->processConfiguration($configuration, $configs);
     return $container->getParameterBag()->resolveValue($config);
 }
开发者ID:shopery,项目名称:doctrine-type-bundle,代码行数:7,代码来源:ShoperyDoctrineTypeExtension.php

示例15: prepend

 /**
  * {@inheritdoc}
  */
 public function prepend(ContainerBuilder $container)
 {
     // process the configuration of SuluCoreExtension
     $configs = $container->getExtensionConfig($this->getAlias());
     $parameterBag = $container->getParameterBag();
     $configs = $parameterBag->resolveValue($configs);
     $config = $this->processConfiguration(new Configuration(), $configs);
     if (isset($config['phpcr'])) {
         $phpcrConfig = $config['phpcr'];
         // TODO: Workaround for issue: https://github.com/doctrine/DoctrinePHPCRBundle/issues/178
         if (!isset($phpcrConfig['backend']['check_login_on_server'])) {
             $phpcrConfig['backend']['check_login_on_server'] = false;
         }
         foreach ($container->getExtensions() as $name => $extension) {
             $prependConfig = [];
             switch ($name) {
                 case 'doctrine_phpcr':
                     $prependConfig = ['session' => $phpcrConfig, 'odm' => []];
                     break;
                 case 'cmf_core':
                     break;
             }
             if ($prependConfig) {
                 $container->prependExtensionConfig($name, $prependConfig);
             }
         }
     }
     if ($container->hasExtension('massive_build')) {
         $container->prependExtensionConfig('massive_build', ['command_class' => 'Sulu\\Bundle\\CoreBundle\\CommandOptional\\SuluBuildCommand']);
     }
 }
开发者ID:ollietb,项目名称:sulu,代码行数:34,代码来源:SuluCoreExtension.php


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