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