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