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


PHP TreeBuilder::buildTree方法代码示例

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


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

示例1: getConfigTree

 /**
  * 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();
 }
开发者ID:rafaelgou,项目名称:PSSDoctrineExtensionsBundle,代码行数:12,代码来源:Configuration.php

示例2: buildConfigTree

 /**
  * @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();
 }
开发者ID:oliverlorenz,项目名称:jimflowklopfer-kanbantool-connector,代码行数:10,代码来源:Configuration.php

示例3: getConfigTree

 /**
  * 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();
 }
开发者ID:nickaggarwal,项目名称:sample-symfony2,代码行数:12,代码来源:Configuration.php

示例4: getConfigTree

 /**
  * 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();
 }
开发者ID:artz20,项目名称:Tv-shows-zone,代码行数:12,代码来源:Configuration.php

示例5: provideTypesAndConfig

 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;
 }
开发者ID:okwinza,项目名称:oauth2-client-bundle,代码行数:25,代码来源:KnpUOAuth2ClientExtensionTest.php

示例6: buildConfigTree

 /**
  * @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();
 }
开发者ID:oliverlorenz,项目名称:php-kanbantool-cli,代码行数:10,代码来源:Configuration.php

示例7: getConfigTree

 /**
  * {@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();
 }
开发者ID:elmariachi111,项目名称:NodrewDfpBundle,代码行数:10,代码来源:Configuration.php

示例8: getConfigTree

 /**
  * 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();
 }
开发者ID:rooster,项目名称:symfony,代码行数:12,代码来源:Configuration.php

示例9: getConfigTree

 /**
  * 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();
 }
开发者ID:helmer,项目名称:GravatarBundle,代码行数:12,代码来源:Configuration.php

示例10: getConfigTreeBuilder

 /**
  * 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();
 }
开发者ID:opcvm360,项目名称:sdk-symfony2,代码行数:12,代码来源:Configuration.php

示例11: getJobTemplatesConfigTree

 /**
  * @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();
 }
开发者ID:a2xchip,项目名称:pim-community-dev,代码行数:10,代码来源:RegisterJobTemplatePass.php

示例12: getConfigTree

 /**
  * 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();
 }
开发者ID:naderman,项目名称:symfony,代码行数:14,代码来源:Configuration.php

示例13: getConfigTree

 /**
  * 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();
 }
开发者ID:rdudzinski,项目名称:TinymceBundle,代码行数:12,代码来源:Configuration.php

示例14: getMainConfigTree

    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();
    }
开发者ID:ruudk,项目名称:symfony,代码行数:26,代码来源:Configuration.php

示例15: load

 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']);
     }
 }
开发者ID:aybbou,项目名称:oauth2-client-bundle,代码行数:29,代码来源:KnpUOAuth2ClientExtension.php


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