getExtensionConfig() public method

Returns the configuration array for the given extension.
public getExtensionConfig ( string $name ) : array
$name string The name of the extension
return array An array of configuration
 /**
  * {@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);
 }
 /**
  * {@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);
 }
 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);
 }
 /**
  * @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));
 }
 /**
  * {@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');
         }
     }
 }
 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']);
 }
 /**
  * {@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);
     }
 }
 /**
  * {@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);
 }
 /**
  * {@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);
 }
 /**
  * @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)))))));
 }
 public function prepend(ContainerBuilder $container)
 {
     $bundles = $container->getParameter('kernel.bundles');
     if (isset($bundles['SonataMediaBundle'])) {
         $this->sonata_media_config = $container->getExtensionConfig('sonata_media')[0];
     }
 }
 /**
  * @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));
         }
     }
 }
 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);
 }
 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);
 }
Example #15
0
 /**
  * {@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']);
     }
 }
 /**
  * {@inheritDoc}
  * @see \Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface::prepend()
  */
 public function prepend(ContainerBuilder $container)
 {
     $bundles = $container->getParameter('kernel.bundles');
     $configs = $container->getExtensionConfig($this->getAlias());
     $config = $this->processConfiguration(new Configuration(), $configs);
     $this->configureTwigBundle($container, $config);
 }
Example #17
0
 public function prepend(ContainerBuilder $container)
 {
     $configs = $container->getExtensionConfig('doctrine');
     $bundles = $container->getParameter('kernel.bundles');
     $mappings = $configs[0]['orm']['mappings'];
     $new_mapping = [];
     $mapping_path = '/Infrastructure/Persistence/Doctrine/Resources/mapping';
     foreach ($bundles as $bundle_name => $bundle_class) {
         if (isset($mappings[$bundle_name])) {
             continue;
         }
         $reflector = new ReflectionClass($bundle_class);
         if (!$reflector->implementsInterface(LoobeeDddBundleStructureInterface::class)) {
             continue;
         }
         preg_match("/^(.+)\\\\([^\\\\]+)Bundle\$/si", $reflector->getNamespaceName(), $math);
         $prefix_ns = substr($math[1], 0, strrpos($math[1], $math[2])) . $math[2];
         $dir = substr($reflector->getFileName(), 0, strrpos($reflector->getFileName(), 'src')) . 'src';
         if (file_exists($dir . $mapping_path)) {
             $dir .= $mapping_path;
         } else {
             $prefix_path = DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $prefix_ns);
             $dir .= $prefix_path . $mapping_path;
         }
         $new_mapping[$bundle_name] = ['type' => 'yml', 'dir' => $dir, 'prefix' => $prefix_ns, 'is_bundle' => false];
     }
     $container->prependExtensionConfig('doctrine', ['orm' => ['entity_managers' => ['default' => ['mappings' => $new_mapping]]]]);
     $container->prependExtensionConfig('doctrine', ['dbal' => ['types' => ['object_value_sample_array' => ObjectValueSampleArray::class]]]);
 }
 public function prepend(ContainerBuilder $container)
 {
     $configs = $container->getExtensionConfig($this->getAlias());
     $config = $this->processConfiguration(new Configuration(), $configs);
     $config = ['globals' => ['bbapp_wrapper_toolbar_id' => $config['toolbar']['wrapper_toolbar_id'], 'bbapp_disable_toolbar' => $config['toolbar']['disable_toolbar']]];
     $container->prependExtensionConfig('twig', $config);
 }
Example #19
0
 public function prepend(ContainerBuilder $container)
 {
     $configs = $container->getExtensionConfig('doctrine');
     $hasDefault = false;
     foreach ($configs as $config) {
         if (isset($config['orm']['entity_managers']['default'])) {
             $hasDefault = true;
             break;
         }
     }
     if (!$hasDefault) {
         return;
     }
     $allBundles = array_keys($container->getParameter('kernel.bundles'));
     $definedBundles = [];
     foreach ($configs as $config) {
         if (empty($config['orm']['entity_managers']) || !is_array($config['orm']['entity_managers'])) {
             continue;
         }
         foreach ($config['orm']['entity_managers'] as $em) {
             if (empty($em['mappings']) || !is_array($em['mappings'])) {
                 continue;
             }
             $definedBundles = array_merge($definedBundles, array_keys($em['mappings']));
         }
     }
     $definedBundles = array_unique($definedBundles);
     $mappings = [];
     foreach (array_diff($allBundles, $definedBundles) as $bundle) {
         $mappings[$bundle] = null;
     }
     $newConfig = ['orm' => ['entity_managers' => ['default' => ['mappings' => $mappings]]]];
     $container->prependExtensionConfig('doctrine', $newConfig);
 }
 /**
  * {@inheritdoc}
  */
 public function prepend(ContainerBuilder $container)
 {
     $config = $this->processConfiguration(new Configuration(), $container->getExtensionConfig($this->getAlias()));
     $this->prependAttribute($container, $config);
     $this->prependVariation($container, $config);
     $this->prependProductAssociation($container, $config);
 }
 /**
  * Prepend our mediabundle config before all other bundles, so we can preset
  * their config with our parameters
  *
  * @param  ContainerBuilder $container
  *
  * @return void
  */
 public function prepend(ContainerBuilder $container)
 {
     $configs = $container->getExtensionConfig($this->getAlias());
     $config = $this->processConfiguration(new Configuration(), $configs);
     $container->setAlias('opifer.media.media_manager', $config['media_manager']);
     $parameters = $this->getParameters($config);
     foreach ($parameters as $key => $value) {
         $container->setParameter($key, $value);
     }
     foreach ($container->getExtensions() as $name => $extension) {
         switch ($name) {
             case 'doctrine':
                 $container->prependExtensionConfig($name, ['orm' => ['resolve_target_entities' => ['Opifer\\MediaBundle\\Model\\MediaInterface' => $config['media_class']]]]);
                 break;
             case 'twig':
                 $container->prependExtensionConfig($name, ['form' => ['resources' => ['OpiferMediaBundle:Form:fields.html.twig']]]);
                 break;
             case 'liip_imagine':
                 $container->prependExtensionConfig($name, ['resolvers' => ['local_storage' => ['web_path' => null], 'aws_storage' => ['aws_s3' => ['client_config' => ['key' => $config['storages']['aws_s3']['key'], 'secret' => $config['storages']['aws_s3']['secret'], 'region' => $config['storages']['aws_s3']['region']], 'bucket' => $config['storages']['aws_s3']['bucket']]]], 'cache' => $config['default_storage'], 'data_loader' => 'stream.file_storage', 'loaders' => ['stream.file_storage' => ['stream' => ['wrapper' => 'gaufrette://file_storage/']]], 'driver' => 'imagick', 'filter_sets' => ['medialibrary' => ['quality' => 100, 'filters' => ['relative_resize' => ['heighten' => 160]]]]]);
                 break;
             case 'knp_gaufrette':
                 $container->prependExtensionConfig($name, ['adapters' => ['tmp_storage' => ['local' => ['directory' => $config['storages']['temp']['directory']]], 'local_storage' => ['local' => ['directory' => $config['storages']['local']['directory']]], 'aws_storage' => ['aws_s3' => ['service_id' => 'opifer.media.aws_s3.client', 'bucket_name' => $config['storages']['aws_s3']['bucket'], 'options' => ['directory' => 'originals', 'acl' => 'public-read']]]], 'filesystems' => ['tmp_storage' => ['adapter' => 'tmp_storage', 'alias' => 'tmp_storage_filesystem'], 'file_storage' => ['adapter' => $config['default_storage'], 'alias' => 'file_storage_filesystem']], 'stream_wrapper' => null]);
                 break;
         }
     }
 }
 /**
  * {@inheritDoc}
  */
 public function process(ContainerBuilder $container)
 {
     // WebHome Auth url in user bar
     if ($container->hasParameter('webhome_auth_url')) {
         $container->getDefinition('webhome.menu.user_bar')->addArgument($container->getParameter('webhome_auth_url'));
     }
     // Listener for build menu
     if (!$container->hasDefinition('webhome.listener.menu')) {
         return;
     }
     $config = $container->getExtensionConfig('ndewez_web_home_common')[0];
     $menuListener = $container->getDefinition('webhome.listener.menu');
     if (isset($config['menu']['getter'])) {
         if (!$container->hasDefinition($config['menu']['getter'])) {
             throw new InvalidArgumentException(sprintf('Service %s doesn\'t exists', $config['menu']['getter']));
         }
         $menuListener->addMethodCall('setGetter', [$container->getDefinition($config['menu']['getter'])]);
     }
     if (isset($config['menu']['builder'])) {
         if (!$container->hasDefinition($config['menu']['builder'])) {
             throw new InvalidArgumentException(sprintf('Service %s doesn\'t exists', $config['menu']['builder']));
         }
         $menuListener->addMethodCall('setBuilderMenuItems', [$container->getDefinition($config['menu']['builder'])]);
     }
     if (isset($config['menu']['builder'])) {
         $menuListener->addMethodCall('setUseSession', [$config['menu']['session']]);
     }
 }
 public function prepend(ContainerBuilder $container)
 {
     $knpMenuConfig['twig'] = true;
     // set to false to disable the Twig extension and the TwigRenderer
     $knpMenuConfig['templating'] = false;
     // if true, enables the helper for PHP templates
     $knpMenuConfig['default_renderer'] = 'twig';
     // The renderer to use, list is also available by default
     $container->prependExtensionConfig('knp_menu', $knpMenuConfig);
     $fosUserConfig['db_driver'] = 'orm';
     // other valid values are 'mongodb', 'couchdb'
     $fosUserConfig['firewall_name'] = 'main';
     $fosUserConfig['user_class'] = 'Kunstmaan\\AdminBundle\\Entity\\User';
     $fosUserConfig['group']['group_class'] = 'Kunstmaan\\AdminBundle\\Entity\\Group';
     $fosUserConfig['resetting']['token_ttl'] = 86400;
     // Use this node only if you don't want the global email address for the resetting email
     $fosUserConfig['resetting']['email']['from_email']['address'] = '*****@*****.**';
     $fosUserConfig['resetting']['email']['from_email']['sender_name'] = 'admin';
     $fosUserConfig['resetting']['email']['template'] = 'FOSUserBundle:Resetting:email.txt.twig';
     $fosUserConfig['resetting']['form']['type'] = 'fos_user_resetting';
     $fosUserConfig['resetting']['form']['name'] = 'fos_user_resetting_form';
     $fosUserConfig['resetting']['form']['validation_groups'] = ['ResetPassword'];
     $container->prependExtensionConfig('fos_user', $fosUserConfig);
     $monologConfig['handlers']['main']['type'] = 'rotating_file';
     $monologConfig['handlers']['main']['path'] = sprintf('%s/%s', $container->getParameter('kernel.logs_dir'), $container->getParameter('kernel.environment'));
     $monologConfig['handlers']['main']['level'] = 'debug';
     $container->prependExtensionConfig('monolog', $monologConfig);
     $configs = $container->getExtensionConfig($this->getAlias());
     $this->processConfiguration(new Configuration(), $configs);
 }
Example #24
0
 /**
  * {@inheritdoc}
  */
 public function prepend(ContainerBuilder $container)
 {
     $config = $this->processConfiguration(new Configuration(), $container->getExtensionConfig($this->getAlias()));
     foreach ($container->getExtensions() as $name => $extension) {
         if (in_array($name, $this->bundles)) {
             $container->prependExtensionConfig($name, ['driver' => $config['driver']]);
         }
     }
     $routeClasses = $controllerByClasses = $repositoryByClasses = $syliusByClasses = [];
     foreach ($config['routing'] as $className => $routeConfig) {
         $routeClasses[$className] = ['field' => $routeConfig['field'], 'prefix' => $routeConfig['prefix']];
         $controllerByClasses[$className] = $routeConfig['defaults']['controller'];
         $repositoryByClasses[$className] = $routeConfig['defaults']['repository'];
         $syliusByClasses[$className] = $routeConfig['defaults']['sylius'];
     }
     $container->prependExtensionConfig('sylius_theme', ['context' => 'sylius.theme.context.channel_based']);
     $container->setParameter('sylius.route_classes', $routeClasses);
     $container->setParameter('sylius.controller_by_classes', $controllerByClasses);
     $container->setParameter('sylius.repository_by_classes', $repositoryByClasses);
     $container->setParameter('sylius.sylius_by_classes', $syliusByClasses);
     $container->setParameter('sylius.route_collection_limit', $config['route_collection_limit']);
     $container->setParameter('sylius.route_uri_filter_regexp', $config['route_uri_filter_regexp']);
     $container->setParameter('sylius.sitemap', $config['sitemap']);
     $container->setParameter('sylius.sitemap_template', $config['sitemap']['template']);
 }
 public function process(ContainerBuilder $container)
 {
     $configs = $container->getExtensionConfig('debril_rss_atom');
     $configTree = new Configuration();
     $processor = new Processor();
     $config = $processor->processConfiguration($configTree, $configs);
     switch ($config['driver']) {
         case 'curl':
             // nothing to do
             break;
         case 'file':
             $container->getDefinition('debril.reader')->replaceArgument(0, new Reference('debril.file'));
             break;
         case 'guzzle':
             if (!isset($config['driver_service'])) {
                 throw new \Exception('When setting debril_rss_atom.driver to "guzzle", you should provide Client service ID in debril_rss_atom.driver_service!');
             }
             $guzzlebridge = $container->getDefinition('debril.http.guzzle_bridge');
             $guzzlebridge->addArgument(new Reference($config['driver_service']));
             $container->getDefinition('debril.reader')->replaceArgument(0, $guzzlebridge);
             break;
         case 'service':
             if (!isset($config['driver_service'])) {
                 throw new \Exception('When setting debril_rss_atom.driver to "service", you should provide service ID in debril_rss_atom.driver_service!');
             }
             $container->getDefinition('debril.reader')->replaceArgument(0, new Reference($config['driver_service']));
             break;
         default:
             throw new \Exception('Unable to handle debril_rss_atom.driver value!');
     }
 }
 /**
  * {@inheritdoc}
  */
 public function prepend(ContainerBuilder $container)
 {
     $configs = $container->getExtensionConfig('sonata_admin');
     if (isset($configs[0]['options']['form_type'])) {
         $container->prependExtensionConfig($this->getAlias(), array('form_type' => $configs[0]['options']['form_type']));
     }
 }
Example #27
0
 /**
  * Load registered bundles' extensions
  */
 protected function loadExtensions()
 {
     $extensions = $this->container->getExtensions();
     foreach ($extensions as $extension) {
         $configs = $this->container->getExtensionConfig($extension->getAlias());
         $extension->load($configs, $this->container);
     }
 }
 /**
  * {@inheritdoc}
  */
 public function prepend(ContainerBuilder $container)
 {
     if (null !== ($frameworkConfiguration = $container->getExtensionConfig('framework'))) {
         if (!isset($frameworkConfiguration['serializer']) || !isset($frameworkConfiguration['serializer']['enabled'])) {
             $container->prependExtensionConfig('framework', ['serializer' => ['enabled' => true]]);
         }
     }
 }
Example #29
0
 /**
  * {@inheritdoc}
  *
  * @throws ServiceNotFoundException
  */
 public function prepend(ContainerBuilder $container)
 {
     if (!$container->hasExtension('fos_oauth_server')) {
         throw new ServiceNotFoundException('FOSOAuthServerBundle must be registered in kernel.');
     }
     $config = $this->processConfiguration(new Configuration(), $container->getExtensionConfig($this->getAlias()));
     $container->prependExtensionConfig('fos_oauth_server', array('db_driver' => 'orm', 'client_class' => $config['classes']['api_client']['model'], 'access_token_class' => $config['classes']['api_access_token']['model'], 'refresh_token_class' => $config['classes']['api_refresh_token']['model'], 'auth_code_class' => $config['classes']['api_auth_code']['model'], 'service' => array('user_provider' => 'sylius.user_provider.name_or_email')));
 }
Example #30
0
 /**
  * {@inheritDoc}
  */
 public function prepend(ContainerBuilder $container)
 {
     $bundles = $container->getParameter('kernel.bundles');
     $configs = $container->getExtensionConfig($this->getAlias());
     if (true === isset($bundles['TwigBundle']) && true === isset($bundles['Zk2UsefulBundle'])) {
         $this->configureTwigBundle($container);
     }
 }