partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

Configuration.php (2292B)


      1 <?php
      2 
      3 namespace PartKeepr\CoreBundle\DependencyInjection;
      4 
      5 use Symfony\Component\Config\Definition\Builder\TreeBuilder;
      6 use Symfony\Component\Config\Definition\ConfigurationInterface;
      7 
      8 class Configuration implements ConfigurationInterface
      9 {
     10     /**
     11      * {@inheritdoc}
     12      */
     13     public function getConfigTreeBuilder()
     14     {
     15         $treeBuilder = new TreeBuilder();
     16         $rootNode = $treeBuilder->root('partkeepr');
     17 
     18         $rootNode->
     19         children()
     20             ->scalarNode('authentication_provider')
     21                 ->cannotBeEmpty()
     22                 ->defaultValue('PartKeepr.Auth.WSSEAuthenticationProvider')
     23                 ->info('The authentication provider for the frontend. Available choices: PartKeepr.Auth.WSSEAuthenticationProvider and PartKeepr.Auth.HTTPBasicAuthenticationProvider')
     24             ->end()
     25             ->scalarNode('tip_of_the_day_uri')
     26                 ->cannotBeEmpty()
     27                 ->defaultValue('https://partkeepr.org/tips/%s')
     28                 ->info('The URI where tips are loaded from')
     29             ->end()
     30             ->arrayNode('required_cronjobs')
     31                 ->treatNullLike([])
     32                 ->prototype('scalar')->end()
     33                 ->defaultValue(['partkeepr:cron:synctips'])
     34             ->end()
     35             ->scalarNode('tip_of_the_day_list')
     36                 ->cannotBeEmpty()
     37                 ->defaultValue('https://partkeepr.org/tips.json')
     38                 ->info('The URI from where the tip database is loaded')
     39             ->end()
     40             ->scalarNode('patreon_status')
     41             ->cannotBeEmpty()
     42             ->defaultValue('https://partkeepr.org/patreon.json')
     43             ->info('The URI from where the patreon status is loaded')
     44             ->end()
     45             ->scalarNode('image_cache_directory')
     46                 ->cannotBeEmpty()
     47                 ->isRequired()
     48                 ->info('The image cache directory')
     49             ->end()
     50                 ->arrayNode('directories')
     51                     ->prototype('scalar')
     52                 ->end()
     53             ->end()
     54             ->booleanNode('cronjob_check')
     55                 ->defaultTrue()
     56                 ->info('Whether the system should check if cronjobs are running or not')
     57                 ->end()
     58             ->end();
     59 
     60         return $treeBuilder;
     61     }
     62 }