/**
  * Generates the configuration tree.
  *
  * @return \Symfony\Component\DependencyInjection\Configuration\NodeInterface
  */
 public function getConfigTree()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('pss_doctrine_extensions');
     $rootNode->children()->arrayNode('blameable')->children()->scalarNode('user_class')->end()->booleanNode('store_object')->defaultValue(false)->end()->arrayNode('drivers')->addDefaultsIfNotSet()->children()->booleanNode('orm')->defaultValue(true)->end()->booleanNode('mongodb')->defaultValue(false)->end()->end()->end()->end()->end()->end();
     return $treeBuilder->buildTree();
 }
 /**
  * @return \Symfony\Component\Config\Definition\NodeInterface
  */
 protected function buildConfigTree()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('allSettings');
     $rootNode->children()->arrayNode('jimFlowKlopfer')->children()->booleanNode('run')->defaultTrue()->end()->scalarNode('command')->isRequired()->end()->scalarNode('photoDirectory')->isRequired()->end()->scalarNode('jsonDirectory')->isRequired()->end()->end()->end()->arrayNode('board')->children()->scalarNode('provider_name')->end()->scalarNode('domain')->isRequired()->end()->scalarNode('apiToken')->isRequired()->end()->scalarNode('boardId')->isRequired()->end()->arrayNode('commands')->children()->scalarNode('move')->isRequired()->end()->end()->end()->scalarNode('ticketRegex')->isRequired()->end()->arrayNode('columns')->prototype('scalar')->end()->end()->end()->end()->end();
     return $treeBuilder->buildTree();
 }
 /**
  * Generates the configuration tree.
  *
  * @return Symfony\Component\Config\Definition\NodeInterface
  */
 public function getConfigTree()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('sensio_framework_extra', 'array');
     $rootNode->children()->arrayNode('router')->children()->booleanNode('annotations')->defaultValue(true)->end()->end()->end()->arrayNode('request')->children()->booleanNode('converters')->defaultValue(true)->end()->end()->end()->arrayNode('view')->children()->booleanNode('annotations')->defaultValue(true)->end()->booleanNode('manager_null_arguments')->defaultValue(true)->end()->end()->end()->arrayNode('cache')->children()->booleanNode('annotations')->defaultValue(true)->end()->end()->end()->end();
     return $treeBuilder->buildTree();
 }
Exemplo n.º 4
0
 /**
  * Generates the configuration tree.
  *
  * @return Symfony\Component\Config\Definition\NodeInterface
  */
 public function getConfigTree()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('sensio_framework_extra', 'array');
     $rootNode->children()->arrayNode('router')->addDefaultsIfNotSet()->children()->booleanNode('annotations')->defaultTrue()->end()->end()->end()->arrayNode('request')->addDefaultsIfNotSet()->children()->booleanNode('converters')->defaultTrue()->end()->end()->end()->arrayNode('view')->addDefaultsIfNotSet()->children()->booleanNode('annotations')->defaultTrue()->end()->end()->end()->arrayNode('cache')->addDefaultsIfNotSet()->children()->booleanNode('annotations')->defaultTrue()->end()->end()->end()->end();
     return $treeBuilder->buildTree();
 }
 public function provideTypesAndConfig()
 {
     $tests = array();
     $extension = new KnpUOAuth2ClientExtension();
     foreach (KnpUOAuth2ClientExtension::getAllSupportedTypes() as $type) {
         $configurator = $extension->getConfigurator($type);
         $tree = new TreeBuilder();
         $configNode = $tree->root('testing');
         $configurator->buildConfiguration($configNode->children(), $type);
         /** @var ArrayNode $arrayNode */
         $arrayNode = $tree->buildTree();
         $config = array('client_id' => 'CLIENT_ID_TEST', 'client_secret' => 'CLIENT_SECRET_TEST', 'redirect_route' => 'go_there', 'redirect_params' => array(), 'use_state' => rand(0, 1) == 0);
         // loop through and assign some random values
         foreach ($arrayNode->getChildren() as $child) {
             /** @var NodeInterface $child */
             if ($child instanceof ArrayNode) {
                 $config[$child->getName()] = array();
             } else {
                 $config[$child->getName()] = rand();
             }
         }
         $tests[] = array($type, $config);
     }
     return $tests;
 }
 /**
  * @return \Symfony\Component\Config\Definition\NodeInterface
  */
 protected function buildConfigTree()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('allSettings');
     $rootNode->children()->scalarNode('domain')->isRequired()->end()->scalarNode('apiToken')->isRequired()->end()->scalarNode('boardId')->isRequired()->end()->end();
     return $treeBuilder->buildTree();
 }
 /**
  * {@inheritDoc}
  */
 public function getConfigTree()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('nodrew_dfp', 'array');
     $rootNode->children()->scalarNode('publisher_id')->isRequired()->cannotBeEmpty()->end()->scalarNode('div_class')->defaultValue('dfp-ad-unit')->end()->variableNode('targets')->end()->end();
     return $treeBuilder->buildTree();
 }
Exemplo n.º 8
0
 /**
  * Generates the configuration tree.
  *
  * @return \Symfony\Component\Config\Definition\NodeInterface
  */
 public function getConfigTree()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('zend', 'array');
     $rootNode->arrayNode('logger')->canBeUnset()->scalarNode('priority')->defaultValue('INFO')->end()->scalarNode('path')->defaultValue('%kernel.logs_dir%/%kernel.environment%.log')->end()->booleanNode('log_errors')->defaultFalse()->end()->end();
     return $treeBuilder->buildTree();
 }
Exemplo n.º 9
0
 /**
  * Generates the configuration tree.
  *
  * @return \Symfony\Component\DependencyInjection\Configuration\NodeInterface
  */
 public function getConfigTree()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('gravatar', 'array');
     $rootNode->children()->scalarNode('size')->defaultValue('80')->end()->scalarNode('rating')->defaultValue('g')->end()->scalarNode('default')->defaultValue('mm')->end()->end();
     return $treeBuilder->buildTree();
 }
Exemplo n.º 10
0
 /**
  * Generates the configuration tree.
  *
  * @return \Symfony\Component\Config\Definition\NodeInterface
  */
 public function getConfigTreeBuilder()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('opcvm360');
     $rootNode->children()->scalarNode('login')->isRequired()->end()->scalarNode('password')->isRequired()->end()->scalarNode('base_url')->end()->end();
     return $treeBuilder->buildTree();
 }
 /**
  * @return NodeInterface
  */
 protected function getJobTemplatesConfigTree()
 {
     $treeBuilder = new TreeBuilder();
     $root = $treeBuilder->root('job_templates');
     $root->useAttributeAsKey('name')->prototype('array')->children()->arrayNode('templates')->children()->scalarNode('show')->end()->scalarNode('edit')->end()->end()->end()->end()->end();
     return $treeBuilder->buildTree();
 }
Exemplo n.º 12
0
 /**
  * Generates the configuration tree.
  *
  * @param Boolean $kernelDebug
  * 
  * @return \Symfony\Component\Config\Definition\ArrayNode The config tree
  */
 public function getConfigTree($kernelDebug)
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('swiftmailer');
     $rootNode->children()->scalarNode('transport')->defaultValue('smtp')->validate()->ifNotInArray(array('smtp', 'mail', 'sendmail', 'gmail', null))->thenInvalid('The %s transport is not supported')->end()->end()->scalarNode('username')->defaultNull()->end()->scalarNode('password')->defaultNull()->end()->scalarNode('host')->defaultValue('localhost')->end()->scalarNode('port')->defaultValue(false)->end()->scalarNode('encryption')->defaultNull()->validate()->ifNotInArray(array('tls', 'ssl', null))->thenInvalid('The %s encryption is not supported')->end()->end()->scalarNode('auth_mode')->defaultNull()->validate()->ifNotInArray(array('plain', 'login', 'cram-md5', null))->thenInvalid('The %s authentication mode is not supported')->end()->end()->arrayNode('spool')->children()->scalarNode('type')->defaultValue('file')->end()->scalarNode('path')->defaultValue('%kernel.cache_dir%/swiftmailer/spool')->end()->end()->end()->scalarNode('delivery_address')->end()->booleanNode('disable_delivery')->end()->booleanNode('logging')->defaultValue($kernelDebug)->end()->end();
     return $treeBuilder->buildTree();
 }
Exemplo n.º 13
0
 /**
  * Generates the configuration tree.
  *
  * @return \Symfony\Component\DependencyInjection\Configuration\NodeInterface
  */
 public function getConfigTree()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('stfalcon_tinymce', 'array');
     $rootNode->children()->scalarNode('mode')->defaultValue('textareas')->validate()->ifNotInArray(array('textareas', 'specific_textareas', 'exact', 'none'))->thenInvalid('TynymceBundle: the %s mode is not supported')->end()->end()->scalarNode('theme')->defaultValue('advanced')->validate()->ifNotInArray(array('advanced', 'simple'))->thenInvalid('TynymceBundle: the %s theme is not supported')->end()->end()->scalarNode('theme_advanced_buttons1')->defaultValue("mylistbox,mysplitbutton,bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,undo,redo,link,unlink")->end()->scalarNode('theme_advanced_buttons2')->defaultValue("")->end()->scalarNode('theme_advanced_buttons3')->defaultValue("")->end()->scalarNode('plugins')->defaultValue("")->end()->booleanNode('include_jquery')->defaultValue("true")->end()->scalarNode('upload_directory')->default("")->end()->scalarNode('web_path')->default("images")->end()->end();
     return $treeBuilder->buildTree();
 }
Exemplo n.º 14
0
    public function getMainConfigTree(array $factories)
    {
        $tb = new TreeBuilder();
        $rootNode = $tb->root('security');

        $rootNode
            ->children()
                ->scalarNode('access_denied_url')->defaultNull()->end()
                ->scalarNode('session_fixation_strategy')->cannotBeEmpty()->defaultValue('migrate')->end()
            ->end()
            // add a faux-entry for factories, so that no validation error is thrown
            ->fixXmlConfig('factory', 'factories')
            ->children()
                ->arrayNode('factories')->ignoreExtraKeys()->end()
            ->end()
        ;

        $this->addAclSection($rootNode);
        $this->addEncodersSection($rootNode);
        $this->addProvidersSection($rootNode);
        $this->addFirewallsSection($rootNode, $factories);
        $this->addAccessControlSection($rootNode);
        $this->addRoleHierarchySection($rootNode);

        return $tb->buildTree();
    }
 public function load(array $configs, ContainerBuilder $container)
 {
     $processor = new Processor();
     $configuration = new Configuration();
     $config = $processor->processConfiguration($configuration, $configs);
     $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
     $loader->load('services.xml');
     $providers = $config['providers'];
     foreach ($providers as $key => $providerConfig) {
         // manually make sure "type" is there
         if (!isset($providerConfig['type'])) {
             throw new InvalidConfigurationException(sprintf('Your "knpu_oauth2_client.providers." config entry is missing the "type" key.', $key));
         }
         $type = $providerConfig['type'];
         unset($providerConfig['type']);
         if (!isset(self::$supportedProviderTypes[$type])) {
             throw new InvalidConfigurationException(sprintf('The "knpu_oauth2_client.providers" config "type" key "%s" is not supported. We support (%s)', $type, implode(', ', self::$supportedProviderTypes)));
         }
         // process the configuration
         $tree = new TreeBuilder();
         $node = $tree->root('knpu_oauth2_client/providers/' . $key);
         $this->buildConfigurationForType($node, $type);
         $processor = new Processor();
         $config = $processor->process($tree->buildTree(), array($providerConfig));
         $configurator = $this->getConfigurator($type);
         // hey, we should add the provider service!
         $this->configureProvider($container, $type, $key, $configurator->getProviderClass(), $configurator->getPackagistName(), $configurator->getProviderOptions($config), $config['redirect_route'], $config['redirect_params']);
     }
 }
Exemplo n.º 16
0
 public function getConfigTree()
 {
     $builder = new TreeBuilder();
     $root = $builder->root('ab');
     $root->children()->scalarNode('db_driver')->isRequired()->cannotBeEmpty()->end()->scalarNode('model_class')->defaultNull()->end()->scalarNode('model_repository')->defaultNull()->end()->scalarNode('load_twig_extension')->defaultValue(true)->treatNullLike(true)->end();
     return $builder->buildTree();
 }
Exemplo n.º 17
0
 public function getConfigTree()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('winzou_cache');
     $rootNode->children()->arrayNode('factory')->addDefaultsIfNotSet()->children()->scalarNode('class')->defaultValue('winzou\\CacheBundle\\CacheFactory')->end()->end()->end()->arrayNode('driver')->addDefaultsIfNotSet()->children()->scalarNode('apc')->defaultValue('winzou\\CacheBundle\\Cache\\ApcCache')->end()->scalarNode('array')->defaultValue('winzou\\CacheBundle\\Cache\\ArrayCache')->end()->scalarNode('file')->defaultValue('winzou\\CacheBundle\\Cache\\FileCache')->end()->scalarNode('memcache')->defaultValue('winzou\\CacheBundle\\Cache\\MemcacheCache')->end()->scalarNode('xcache')->defaultValue('winzou\\CacheBundle\\Cache\\XcacheCache')->end()->scalarNode('zenddata')->defaultValue('winzou\\CacheBundle\\Cache\\ZendDataCache')->end()->end()->end()->arrayNode('options')->addDefaultsIfNotSet()->children()->scalarNode('cache_dir')->defaultValue('%kernel.cache_dir%/winzou_cache')->end()->scalarNode('default_driver')->defaultValue('file')->end()->end()->end()->end();
     return $treeBuilder->buildTree();
 }
Exemplo n.º 18
0
    /**
     * Generates the configuration tree.
     *
     * @param boolean $kernelDebug The kernel.debug DIC parameter
     * @return \Symfony\Component\Config\Definition\NodeInterface
     */
    public function getConfigTree($kernelDebug)
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('framework', 'array');

        $rootNode
            ->scalarNode('cache_warmer')->defaultValue(!$kernelDebug)->end()
            ->scalarNode('charset')->end()
            ->scalarNode('document_root')->end()
            ->scalarNode('error_handler')->end()
            ->scalarNode('exception_controller')->end()
            ->scalarNode('ide')->end()
            ->booleanNode('test')->end()
        ;

        $this->addCsrfProtectionSection($rootNode);
        $this->addEsiSection($rootNode);
        $this->addProfilerSection($rootNode);
        $this->addRouterSection($rootNode);
        $this->addSessionSection($rootNode);
        $this->addTemplatingSection($rootNode);
        $this->addTranslatorSection($rootNode);
        $this->addValidationSection($rootNode);

        return $treeBuilder->buildTree();
    }
Exemplo n.º 19
0
    public function getConfigTree()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('adyen', 'array');

        $rootNode
            ->children()
                ->scalarNode('platform')
                    ->validate()
                        ->ifNotInArray(array('live', 'test'))
                        ->thenInvalid('The %s platform is not supported')
                    ->end()
                ->end()
                ->scalarNode('merchant_account')->isRequired()->end()
                ->scalarNode('skin')->isRequired()->end()
                ->scalarNode('shared_secret')->isRequired()->end()
                ->scalarNode('currency')->defaultValue('USD')->end()
                ->scalarNode('update_charge_amount')->defaultValue('2')->end()
                ->scalarNode('subscription_entity')->isRequired()->end()
                ->scalarNode('plan_entity')->isRequired()->end()
                ->scalarNode('transaction_entity')->isRequired()->end()
                ->scalarNode('webservice_username')->isRequired()->end()
                ->scalarNode('webservice_password')->isRequired()->end()
                ->scalarNode('payment_methods')->defaultValue('mc,visa,amex')->end()
                ->scalarNode('orm_entity_manager')->defaultValue('doctrine.orm.default_entity_manager')->end()
            ->end();

        return $treeBuilder->buildTree();
    }
Exemplo n.º 20
0
 /**
  * Generates the configuration tree.
  *
  * @return \Symfony\Component\Config\Definition\ArrayNode The config tree
  */
 public function getConfigTree()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('web_profiler');
     $rootNode->children()->booleanNode('verbose')->defaultTrue()->end()->booleanNode('toolbar')->defaultFalse()->end()->booleanNode('intercept_redirects')->defaultFalse()->end()->end();
     return $treeBuilder->buildTree();
 }
Exemplo n.º 21
0
 /**
  * Generates the configuration tree.
  *
  * @return \Symfony\Component\Config\Definition\NodeInterface
  */
 public function getConfigTree($kernelDebug)
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('assetic', 'array');
     $rootNode->booleanNode('debug')->defaultValue($kernelDebug)->end()->booleanNode('use_controller')->defaultValue($kernelDebug)->end()->scalarNode('document_root')->defaultValue('%kernel.root_dir%/../web')->end()->scalarNode('closure')->end()->scalarNode('yui')->end()->scalarNode('default_javascripts_output')->defaultValue('js/*.js')->end()->scalarNode('default_stylesheets_output')->defaultValue('css/*.css')->end();
     return $treeBuilder->buildTree();
 }
 /**
  * Gets the configuration tree for the extension.
  * 
  * @return Tree The configuration tree
  */
 public function getConfigTree()
 {
     $tb = new TreeBuilder();
     $root = $tb->root('vich_geographical');
     $root->children()->arrayNode('orm')->useAttributeAsKey('id')->prototype('array')->performNoDeepMerging()->children()->scalarNode('enabled')->defaultTrue()->end()->end()->end()->end()->arrayNode('twig')->performNoDeepMerging()->addDefaultsIfNotSet()->children()->scalarNode('enabled')->defaultFalse()->end()->end()->end()->arrayNode('class')->addDefaultsIfNotSet()->children()->scalarNode('query_service')->cannotBeEmpty()->defaultValue('Vich\\GeographicalBundle\\QueryService\\GoogleQueryService')->end()->scalarNode('map_renderer')->cannotBeEmpty()->defaultValue('Vich\\GeographicalBundle\\Map\\Renderer\\GoogleMapRenderer')->end()->end()->end()->arrayNode('leaflet')->addDefaultsIfNotSet()->children()->scalarNode('api_key')->defaultNull()->end()->end()->end()->arrayNode('bing')->addDefaultsIfNotSet()->children()->scalarNode('api_key')->defaultNull()->end()->end()->end()->end();
     return $tb->buildTree();
 }
Exemplo n.º 23
0
 /**
  * Generates the configuration tree.
  *
  * @return \Symfony\Component\Config\Definition\ArrayNode The config tree
  */
 public function getConfigTree()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('web_service');
     $rootNode->children()->arrayNode('services')->prototype('array')->children()->scalarNode('name')->isRequired()->end()->scalarNode('namespace')->isRequired()->end()->scalarNode('resource')->defaultValue('*')->end()->scalarNode('resource_type')->defaultValue('annotation')->end()->scalarNode('binding')->defaultValue('document-wrapped')->validate()->ifNotInArray(array('rpc-literal', 'document-wrapped'))->thenInvalid("Service binding style has to be either 'rpc-literal' or 'document-wrapped'")->end()->end()->end()->end()->end();
     return $treeBuilder->buildTree();
 }
Exemplo n.º 24
0
 /**
  * Generates the configuration tree.
  *
  * @return \Symfony\Component\DependencyInjection\Configuration\NodeInterface
  */
 public function getConfigTree()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('jns_xhprof');
     $rootNode->children()->scalarNode('location_config')->defaultValue('/opt/local/www/php5-xhprof/xhprof_lib/config.php')->end()->scalarNode('location_lib')->defaultValue('/opt/local/www/php5-xhprof/xhprof_lib/utils/xhprof_lib.php')->end()->scalarNode('location_runs')->defaultValue('/opt/local/www/php5-xhprof/xhprof_lib/utils/xhprof_runs.php')->end()->scalarNode('location_web')->defaultValue('http://xhprof')->end()->scalarNode('enabled')->defaultFalse()->end()->end();
     return $treeBuilder->buildTree();
 }
Exemplo n.º 25
0
 /**
  * Generates the configuration tree.
  *
  * @return \Symfony\Component\Config\Definition\NodeInterface
  */
 public function getConfigTree()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('doctrine_migrations', 'array');
     $rootNode->scalarNode('dir_name')->defaultValue('%kernel.root_dir%/DoctrineMigrations')->cannotBeEmpty()->end()->scalarNode('namespace')->defaultValue('Application\\Migrations')->cannotBeEmpty()->end()->scalarNode('table_name')->defaultValue('migration_versions')->cannotBeEmpty()->end()->scalarNode('name')->defaultValue('Application Migrations')->end();
     return $treeBuilder->buildTree();
 }
Exemplo n.º 26
0
 /**
  * Generates the configuration tree.
  *
  * @return Symfony\Component\Config\Definition\NodeInterface
  */
 public function getConfigTree()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('david_badura_faker', 'array');
     $rootNode->children()->scalarNode('locale')->defaultValue('en_US')->end()->end();
     return $treeBuilder->buildTree();
 }
Exemplo n.º 27
0
 public function testConfigTreeBuilder()
 {
     $tree = new TreeBuilder();
     $node = $tree->root('webpack')->children();
     ProvidePlugin::applyConfiguration($node);
     $node->end();
     $config = $tree->buildTree()->finalize([]);
 }
Exemplo n.º 28
0
 /**
  * {@inheritdoc}
  * @throws \RuntimeException
  */
 public function getWorkerTree()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('root');
     $rootNode->ignoreExtraKeys(true);
     $rootNode->children()->append($this->buildResolverNode())->append($this->buildGeneratorNode())->end();
     return $treeBuilder->buildTree();
 }
Exemplo n.º 29
0
 /**
  * Generates the configuration tree.
  *
  * @return Symfony\Component\DependencyInjection\Configuration\NodeInterface
  */
 public function getConfigTree()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('mandango', 'array');
     $rootNode->children()->scalarNode('model_dir')->end()->booleanNode('logging')->end()->scalarNode('default_connection')->end()->end()->fixXmlConfig('extra_config_classes_dir')->children()->arrayNode('extra_config_classes_dirs')->prototype('scalar')->end()->end();
     $this->addConnectionsSection($rootNode);
     return $treeBuilder->buildTree();
 }
 /**
  * Generates the configuration tree.
  *
  * @return Symfony\Component\DependencyInjection\Configuration\NodeInterface
  */
 public function getConfigTree()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('white_october_simple_admin');
     $this->addDataManagersSection($rootNode);
     $this->addAdminsSection($rootNode);
     return $treeBuilder->buildTree();
 }