vendor/lexik/maintenance-bundle/DependencyInjection/Configuration.php line 24

Open in your IDE?
  1. <?php
  2. namespace Lexik\Bundle\MaintenanceBundle\DependencyInjection;
  3. use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  4. use Symfony\Component\Config\Definition\ConfigurationInterface;
  5. /**
  6.  * This is the class that validates and merges configuration from your app/config files
  7.  *
  8.  * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
  9.  *
  10.  * @package LexikMaintenanceBundle
  11.  * @author  Gilles Gauthier <g.gauthier@lexik.fr>
  12.  */
  13. class Configuration implements ConfigurationInterface
  14. {
  15.     /**
  16.      * {@inheritDoc}
  17.      */
  18.     public function getConfigTreeBuilder()
  19.     {
  20.         $treeBuilder = new TreeBuilder();
  21.         $rootNode $treeBuilder->root('lexik_maintenance');
  22.         $rootNode
  23.             ->addDefaultsIfNotSet()
  24.             ->children()
  25.                 ->arrayNode('authorized')
  26.                     ->addDefaultsIfNotSet()
  27.                     ->children()
  28.                         ->scalarNode('path')
  29.                             ->defaultNull()
  30.                         ->end()
  31.                         ->scalarNode('host')
  32.                             ->defaultNull()
  33.                         ->end()
  34.                         ->variableNode('ips')
  35.                             ->defaultNull()
  36.                         ->end()
  37.                         ->variableNode('query')
  38.                             ->defaultValue(array())
  39.                         ->end()
  40.                         ->variableNode('cookie')
  41.                             ->defaultValue(array())
  42.                         ->end()
  43.                         ->scalarNode('route')
  44.                             ->defaultNull()
  45.                         ->end()
  46.                         ->variableNode('attributes')
  47.                             ->defaultValue(array())
  48.                         ->end()
  49.                     ->end()
  50.                 ->end()
  51.                 ->arrayNode('driver')
  52.                     ->addDefaultsIfNotSet()
  53.                     ->children()
  54.                         ->scalarNode('class')
  55.                             ->defaultNull()
  56.                         ->end()
  57.                         ->integerNode('ttl')
  58.                             ->defaultNull()
  59.                         ->end()
  60.                         ->variableNode('options')
  61.                             ->defaultValue(array())
  62.                         ->end()
  63.                     ->end()
  64.                 ->end()
  65.                 ->arrayNode('response')
  66.                     ->addDefaultsIfNotSet()
  67.                     ->children()
  68.                         ->integerNode('code')
  69.                             ->defaultValue503 )
  70.                         ->end()
  71.                         ->scalarNode('status')
  72.                             ->defaultValue('Service Temporarily Unavailable')
  73.                         ->end()
  74.                         ->scalarNode('exception_message')
  75.                             ->defaultValue('Service Temporarily Unavailable')
  76.                         ->end()
  77.                     ->end()
  78.                 ->end()
  79.             ->end();
  80.         return $treeBuilder;
  81.     }
  82. }