/DependencyInjection/Configuration.php
http://github.com/FriendsOfSymfony/FOSFacebookBundle · PHP · 66 lines · 39 code · 6 blank · 21 comment · 0 complexity · dbe462e10ccff88067359331a8a9daa8 MD5 · raw file
- <?php
- /*
- * This file is part of the FOSFacebookBundle package.
- *
- * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
- namespace FOS\FacebookBundle\DependencyInjection;
- use Symfony\Component\Config\Definition\Builder\TreeBuilder,
- Symfony\Component\Config\Definition\ConfigurationInterface;
- /**
- * This class contains the configuration information for the bundle
- *
- * This information is solely responsible for how the different configuration
- * sections are normalized, and merged.
- *
- * @author Lukas Kahwe Smith <smith@pooteeweet.org>
- */
- class Configuration implements ConfigurationInterface
- {
- /**
- * Generates the configuration tree.
- *
- * @return TreeBuilder
- */
- public function getConfigTreeBuilder()
- {
- $treeBuilder = new TreeBuilder();
- $rootNode = $treeBuilder->root('fos_facebook');
- $rootNode
- ->fixXmlConfig('permission', 'permissions')
- ->children()
- ->scalarNode('app_id')->isRequired()->cannotBeEmpty()->end()
- ->scalarNode('secret')->isRequired()->cannotBeEmpty()->end()
- ->scalarNode('cookie')->defaultFalse()->end()
- ->scalarNode('domain')->defaultNull()->end()
- ->scalarNode('alias')->defaultNull()->end()
- ->scalarNode('logging')->defaultValue('%kernel.debug%')->end()
- ->scalarNode('culture')->defaultValue('en_US')->end()
- ->arrayNode('class')
- ->addDefaultsIfNotSet()
- ->children()
- ->scalarNode('api')->defaultValue('FOS\FacebookBundle\Facebook\FacebookSessionPersistence')->end()
- ->scalarNode('helper')->defaultValue('FOS\FacebookBundle\Templating\Helper\FacebookHelper')->end()
- ->scalarNode('twig')->defaultValue('FOS\FacebookBundle\Twig\Extension\FacebookExtension')->end()
- ->end()
- ->end()
- ->arrayNode('channel')
- ->addDefaultsIfNotSet()
- ->children()
- ->scalarNode('expire')->defaultValue(60*60*24*365)->end()
- ->end()
- ->end()
- ->arrayNode('permissions')->prototype('scalar')->end()
- ->end();
- return $treeBuilder;
- }
- }