vendor/sulu/sulu/src/Sulu/Bundle/DocumentManagerBundle/DependencyInjection/Configuration.php line 74

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of Sulu.
  4.  *
  5.  * (c) Sulu GmbH
  6.  *
  7.  * This source file is subject to the MIT license that is bundled
  8.  * with this source code in the file LICENSE.
  9.  */
  10. namespace Sulu\Bundle\DocumentManagerBundle\DependencyInjection;
  11. use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  12. use Symfony\Component\Config\Definition\ConfigurationInterface;
  13. class Configuration implements ConfigurationInterface
  14. {
  15.     public function getConfigTreeBuilder(): TreeBuilder
  16.     {
  17.         $treeBuilder = new TreeBuilder('sulu_document_manager');
  18.         $rootNode $treeBuilder->getRootNode();
  19.         $rootNode
  20.             ->children()
  21.                 ->scalarNode('default_session')->end()
  22.                 ->scalarNode('live_session')->end()
  23.                 ->arrayNode('sessions')
  24.                     ->useAttributeAsKey('name')
  25.                     ->prototype('array')
  26.                         ->children()
  27.                             ->arrayNode('backend')
  28.                                 ->useAttributeAsKey('name')
  29.                                 ->prototype('variable')->end()
  30.                             ->end()
  31.                             ->scalarNode('workspace')
  32.                                 ->isRequired()
  33.                                 ->cannotBeEmpty()
  34.                             ->end()
  35.                             ->scalarNode('username')
  36.                                 ->defaultValue('admin')
  37.                             ->end()
  38.                             ->scalarNode('password')
  39.                                 ->defaultValue('admin')
  40.                             ->end()
  41.                         ->end()
  42.                     ->end()
  43.                 ->end()
  44.                 ->arrayNode('namespace')
  45.                     ->useAttributeAsKey('role')
  46.                     ->defaultValue([
  47.                         'extension_localized' => 'i18n',
  48.                         'system' => 'sulu',
  49.                         'system_localized' => 'i18n',
  50.                         'content' => null,
  51.                         'content_localized' => 'i18n',
  52.                     ])
  53.                     ->prototype('scalar')->end()
  54.                 ->end()
  55.                 ->arrayNode('versioning')
  56.                     ->canBeEnabled()
  57.                 ->end()
  58.                 ->scalarNode('debug')
  59.                     ->info('Enable the debug event dispatcher. Logs all document manager events. Very slow.')
  60.                     ->defaultValue(false)
  61.                 ->end()
  62.                 ->arrayNode('path_segments')
  63.                     ->useAttributeAsKey('key')
  64.                     ->prototype('scalar')->end()
  65.                 ->end()
  66.                 ->scalarNode('slugifier')
  67.                     ->defaultValue('Sulu\Bundle\DocumentManagerBundle\Slugifier\Urlizer::urlize')
  68.                     ->setDeprecated(
  69.                         'The "sulu_document_manager.slugifier" configuration is not used anymore since 2.1 '
  70.                         'and will be removed in 3.0.'
  71.                     )
  72.                 ->end()
  73.                 ->arrayNode('mapping')
  74.                     ->useAttributeAsKey('alias')
  75.                     ->prototype('array')
  76.                         ->children()
  77.                             ->scalarNode('class')
  78.                                 ->info('Fully qualified class name for mapped object')
  79.                                 ->isRequired()
  80.                             ->end()
  81.                             ->scalarNode('phpcr_type')
  82.                                 ->info('PHPCR type to map to')
  83.                                 ->isRequired()
  84.                             ->end()
  85.                             ->scalarNode('form_type')
  86.                                 ->info('Form type to map to')
  87.                             ->end()
  88.                             ->scalarNode('sync_remove_live')
  89.                                 ->info('Should sync live workspace if node was removed')
  90.                             ->end()
  91.                             ->scalarNode('set_default_author')
  92.                                 ->info('Set default author if none set')
  93.                             ->end()
  94.                             ->arrayNode('mapping')
  95.                                 ->prototype('array')
  96.                                     ->children()
  97.                                         ->scalarNode('encoding')->defaultValue('content')->end()
  98.                                         ->scalarNode('property')->end()
  99.                                         ->scalarNode('type')->end()
  100.                                         ->booleanNode('mapped')->defaultTrue()->end()
  101.                                         ->booleanNode('multiple')->defaultFalse()->end()
  102.                                         ->scalarNode('default')->defaultValue(null)->end()
  103.                                     ->end()
  104.                                 ->end()
  105.                             ->end()
  106.                         ->end()
  107.                     ->end()
  108.                 ->end()
  109.             ->end();
  110.         return $treeBuilder;
  111.     }
  112. }