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


PHP NodeDefinition::fixXmlConfig方法代码示例

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


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

示例1: addConfiguration

 public function addConfiguration(NodeDefinition $node)
 {
     $node->fixXmlConfig('user_provider');
     $builder = $node->beforeNormalization()->ifTrue(function ($v) {
         return isset($v['key']);
     })->then(function ($v) {
         if (isset($v['secret'])) {
             throw new \LogicException('Cannot set both key and secret options for remember_me, use only secret instead.');
         }
         @trigger_error('remember_me.key is deprecated since version 2.8 and will be removed in 3.0. Use remember_me.secret instead.', E_USER_DEPRECATED);
         $v['secret'] = $v['key'];
         unset($v['key']);
         return $v;
     })->end()->children();
     $builder->scalarNode('secret')->isRequired()->cannotBeEmpty()->end()->scalarNode('token_provider')->end()->arrayNode('user_providers')->beforeNormalization()->ifString()->then(function ($v) {
         return array($v);
     })->end()->prototype('scalar')->end()->end()->scalarNode('catch_exceptions')->defaultTrue()->end();
     foreach ($this->options as $name => $value) {
         if (is_bool($value)) {
             $builder->booleanNode($name)->defaultValue($value);
         } else {
             $builder->scalarNode($name)->defaultValue($value);
         }
     }
 }
开发者ID:tsurune,项目名称:Pruebas,代码行数:25,代码来源:RememberMeFactory.php

示例2: addConfiguration

 /**
  * {@inheritdoc}
  */
 public function addConfiguration(NodeDefinition $node)
 {
     $node->fixXmlConfig('header')->children()->scalarNode('auth_header')->cannotBeEmpty()->defaultValue('Authorization')->end()->scalarNode('service_label')->cannotBeEmpty()->defaultValue('HMAC')->end()->scalarNode('algorithm')->beforeNormalization()->ifString()->then(function ($v) {
         return strtolower($v);
     })->end()->validate()->ifNotInArray(hash_algos())->thenInvalid('value %s is not supported, see hash_algos() for available hashing algorithms.')->end()->defaultValue('sha256')->end()->arrayNode('verify_headers')->beforeNormalization()->ifString()->then(function ($v) {
         return array_map('trim', explode(',', $v));
     })->end()->prototype('scalar')->end()->end()->end();
 }
开发者ID:wridgers,项目名称:GremoHmacAuthenticationBundle,代码行数:11,代码来源:HmacFactory.php

示例3: addConfiguration

 public function addConfiguration(NodeDefinition $node)
 {
     $builder = $node->fixXmlConfig('user_provider')->children();
     $builder->scalarNode('secret')->isRequired()->cannotBeEmpty()->end()->scalarNode('token_provider')->end()->arrayNode('user_providers')->beforeNormalization()->ifString()->then(function ($v) {
         return array($v);
     })->end()->prototype('scalar')->end()->end()->scalarNode('catch_exceptions')->defaultTrue()->end();
     foreach ($this->options as $name => $value) {
         if (is_bool($value)) {
             $builder->booleanNode($name)->defaultValue($value);
         } else {
             $builder->scalarNode($name)->defaultValue($value);
         }
     }
 }
开发者ID:ninvfeng,项目名称:symfony,代码行数:14,代码来源:RememberMeFactory.php

示例4: addConfiguration

 public function addConfiguration(NodeDefinition $node)
 {
     $node->fixXmlConfig('authenticator')->children()->scalarNode('provider')->info('A key from the "providers" section of your security config, in case your user provider is different than the firewall')->end()->scalarNode('entry_point')->info('A service id (of one of your authenticators) whose start() method should be called when an anonymous user hits a page that requires authentication')->defaultValue(null)->end()->arrayNode('authenticators')->info('An array of service ids for all of your "authenticators"')->requiresAtLeastOneElement()->prototype('scalar')->end()->end()->end();
 }
开发者ID:pierreleplatois,项目名称:sialab,代码行数:4,代码来源:GuardAuthenticationFactory.php

示例5: addConfiguration

 public function addConfiguration(NodeDefinition $node)
 {
     $node->fixXmlConfig('user')->children()->arrayNode('users')->useAttributeAsKey('username')->prototype('scalar')->end()->end()->end();
 }
开发者ID:javiereguiluz,项目名称:SensioLabsConnectBundle,代码行数:4,代码来源:ConnectInMemoryFactory.php

示例6: addConfiguration

 public function addConfiguration(NodeDefinition $node)
 {
     $node->fixXmlConfig('user')->children()->arrayNode('users')->useAttributeAsKey('name')->prototype('array')->children()->scalarNode('password')->defaultValue(uniqid('', true))->end()->arrayNode('roles')->beforeNormalization()->ifString()->then(function ($v) {
         return preg_split('/\\s*,\\s*/', $v);
     })->end()->prototype('scalar')->end()->end()->end()->end()->end()->end();
 }
开发者ID:Ener-Getick,项目名称:symfony,代码行数:6,代码来源:InMemoryFactory.php


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