Adds semantic configuration definition.

@param \Symfony\Component\Config\Definition\Builder\NodeBuilder $nodeBuilder Node just under ezpublish.system.<siteaccess>
515256
public function addSemanticConfig(NodeBuilder $nodeBuilder)
    {
        $nodeBuilder
            ->arrayNode('security')
                ->info('System security configuration.')
                ->children()
                    ->scalarNode('token_interval_spec')
                        ->info('Token ttl as DateInterval. See http://php.net/manual/dateinterval.construct.php')
                        ->isRequired()
                    ->end()
                ->end()
            ->end();
    }
1024838
public function autoWireServices(ContainerBuilder $containerBuilder): void
    {
        $services = $this->getServices();
        foreach ($services as $class) {
            $containerBuilder->autowire($class, $class)->setPublic(true);
        }
    }
133578
public function addNodeTypeFilterConstraintsToQueryBuilder(QueryBuilder $queryBuilder, $nodeTypeFilter)
    {
        $constraints = $this->getNodeTypeFilterConstraintsForDql($nodeTypeFilter);
        if (count($constraints['includeNodeTypes']) > 0) {
            $queryBuilder->andWhere('n.nodeType IN (:includeNodeTypes)')
                ->setParameter('includeNodeTypes', $constraints['includeNodeTypes']);
        }
        if (count($constraints['excludeNodeTypes']) > 0) {
            $queryBuilder->andWhere('n.nodeType NOT IN (:excludeNodeTypes)')
                ->setParameter('excludeNodeTypes', $constraints['excludeNodeTypes']);
        }
    }
1144481
public function build(ContainerBuilder $container)
    {
        /** @var \eZ\Bundle\EzPublishCoreBundle\DependencyInjection\EzPublishCoreExtension $core */
        $core = $container->getExtension('ezpublish');

        $configParsers = $this->getConfigParsers();
        array_walk($configParsers, [$core, 'addConfigParser']);

        $core->addDefaultSettings(__DIR__ . '/Resources/config', ['ezplatform_default_settings.yml']);

        $this->addCompilerPasses($container);
    }
353933
protected function instantiationOptions(SchemaBuilder $builder)
    {
        if ($this->getInstantiator() != DocumentInstantiator::class) {
            //Unable to define options for non default inheritance based instantiator
            return null;
        }

        //Let's define a way how to separate one model from another based on given fields
        $helper = new InheritanceHelper($this, $builder->getSchemas());

        return $helper->makeDefinition();
    }
1349291
public function getConfigTreeBuilder()
    {
        $builder = new TreeBuilder();

        $node = $builder->root('rocketeer')->children();
        foreach ($this->definitions as $definition) {
            /** @var AbstractDefinition $definition */
            $definition = new $definition();
            $definition->setValues($this->values);
            $definition = $definition->getConfigTreeBuilder();

            $node = $node->append($definition);
        }
        $node = $node->end();

        return $builder;
    }
540128
public function addSemanticConfig(NodeBuilder $nodeBuilder)
    {
        $nodeBuilder
            ->arrayNode(static::NODE_KEY)
                ->info(static::INFO)
                ->children()
                    ->arrayNode('block')
                        ->useAttributeAsKey('key')
                        ->normalizeKeys(false)
                        ->prototype('array')
                            ->children()
                                ->scalarNode('template')->isRequired()->info('Your template path, as MyBundle:subdir:my_template.html.twig')->end()
                                ->scalarNode('controller')
                                    ->info(
<<<EOT
Use custom controller instead of the default one to display a block matching your rules.
You can use the controller reference notation supported by Symfony.
EOT
                                    )
                                    ->example('MyBundle:MyControllerClass:viewBlock')
                                ->end()
                                ->arrayNode('match')
                                    ->info('Condition matchers configuration')
                                    ->useAttributeAsKey('key')
                                    ->prototype('variable')->end()
                                ->end()
                            ->end()
                        ->end()
                    ->end()
                ->end()
                ->beforeNormalization()
                ->always()
                    ->then(
                        // Adding one 'block' level in order to match the other view internal config structure.
                        function ($v) {
                            return array('block' => $v);
                        }
                    )
                ->end()
            ->end();
    }
819725
private function addBundleConfiguration(NodeBuilder $node)
    {
        $node
            ->arrayNode('bundles')
                ->defaultValue($this->bundles)
                ->prototype('scalar')
                    ->validate()
                    ->ifNotInArray($this->bundles)
                    ->thenInvalid('%s is not a valid bundle.')
                ->end()
            ->end();
    }
755181
public function prepend(ContainerBuilder $container)
    {
        $coreExtensionConfigFile = realpath(__DIR__ . '/../Resources/config/prepend/ezpublish.yml');
        $container->prependExtensionConfig('ezpublish', Yaml::parseFile($coreExtensionConfigFile));
        $container->addResource(new FileResource($coreExtensionConfigFile));
    }
1356971
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder('sonata_doctrine_phpcr_admin');

        // Keep compatibility with symfony/config < 4.2
        if (!method_exists($treeBuilder, 'getRootNode')) {
            $rootNode = $treeBuilder->root('sonata_doctrine_phpcr_admin');
        } else {
            $rootNode = $treeBuilder->getRootNode();
        }

        $rootNode
            ->fixXmlConfig('template')
            ->children()
                ->arrayNode('templates')
                    ->children()
                        ->arrayNode('form')
                            ->prototype('scalar')->end()
                            ->defaultValue(['@SonataDoctrinePHPCRAdmin/Form/form_admin_fields.html.twig'])
                        ->end()
                        ->arrayNode('filter')
                            ->prototype('scalar')->end()
                            ->defaultValue(['@SonataDoctrinePHPCRAdmin/Form/filter_admin_fields.html.twig'])
                        ->end()
                        ->arrayNode('types')
                            ->children()
                                ->arrayNode('list')
                                    ->useAttributeAsKey('name')
                                    ->prototype('scalar')->end()
                                ->end()
                                ->arrayNode('show')
                                    ->useAttributeAsKey('name')
                                    ->prototype('scalar')->end()
                                ->end()
                            ->end()
                        ->end()
                        ->scalarNode('pager_results')->defaultValue('@SonataDoctrinePHPCRAdmin/Pager/simple_pager_results.html.twig')->cannotBeEmpty()->end()
                    ->end()
                ->end()
                ->arrayNode('document_tree')
                    ->addDefaultsIfNotSet()
                    ->canBeEnabled()
                    ->children()
                        ->scalarNode('repository_name')
                            ->defaultNull()
                            ->info('The repository name the resource API connects to.')
                        ->end()
                        ->arrayNode('routing_defaults')
                            ->prototype('scalar')->end()
                            ->info('Routing defaults passed to the resources API call.')
                        ->end()
                        ->scalarNode('sortable_by')
                            ->defaultValue('position')
                            ->info('Defines by which property to sort sibling documents.')
                        ->end()
                    ->end()
                ->end()
            ->end()
        ;

        return $treeBuilder;
    }
465013
protected function loadConfiguration(ContainerBuilder $container)
    {
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . "/../Config/Resources"));
        $finder = Finder::create()
            ->name('*.xml')
            ->depth(0)
            ->in(__DIR__ . "/../Config/Resources");

        /** @var \SplFileInfo $file */
        foreach ($finder as $file) {
            $loader->load($file->getBaseName());
        }

        if (\defined("THELIA_INSTALL_MODE") === false) {
            $modules = ModuleQuery::getActivated();

            $translationDirs = array();



            /** @var Module $module */
            foreach ($modules as $module) {
                try {
                    $definition = new Definition();
                    $definition->setClass($module->getFullNamespace());
                    $definition->addMethodCall("setContainer", array(new Reference('service_container')));

                    $container->setDefinition(
                        "module." . $module->getCode(),
                        $definition
                    );

                    $compilers = \call_user_func(array($module->getFullNamespace(), 'getCompilers'));

                    foreach ($compilers as $compiler) {
                        if (\is_array($compiler)) {
                            $container->addCompilerPass($compiler[0], $compiler[1]);
                        } else {
                            $container->addCompilerPass($compiler);
                        }
                    }

                    $loader = new XmlFileLoader($container, new FileLocator($module->getAbsoluteConfigPath()));
                    $loader->load("config.xml", "module." . $module->getCode());

                    $envConfigFileName = sprintf("config_%s.xml", $this->environment);
                    $envConfigFile = sprintf('%s%s%s', $module->getAbsoluteConfigPath(), DS, $envConfigFileName);

                    if (is_file($envConfigFile) && is_readable($envConfigFile)) {
                        $loader->load($envConfigFileName, "module." . $module->getCode());
                    }
                } catch (\Exception $e) {
                    Tlog::getInstance()->addError(
                        sprintf("Failed to load module %s: %s", $module->getCode(), $e->getMessage()),
                        $e
                    );
                }
            }

            $parser = $container->getDefinition('thelia.parser');

            /** @var \Thelia\Core\Template\TemplateHelperInterface $templateHelper */
            $templateHelper = $container->get('thelia.template_helper');

            /** @var Module $module */
            foreach ($modules as $module) {
                try {
                    $this->loadModuleTranslationDirectories($module, $translationDirs, $templateHelper);

                    $this->addStandardModuleTemplatesToParserEnvironment($parser, $module);
                } catch (\Exception $e) {
                    Tlog::getInstance()->addError(
                        sprintf("Failed to load module %s: %s", $module->getCode(), $e->getMessage()),
                        $e
                    );
                }
            }

            // Load core translation
            $translationDirs['core'] = THELIA_LIB . 'Config' . DS . 'I18n';

            // Load core translation
            $translationDirs[Translator::GLOBAL_FALLBACK_DOMAIN] = THELIA_LOCAL_DIR . 'I18n';

            // Standard templates (front, back, pdf, mail)
            /** @var TemplateDefinition $templateDefinition */
            foreach ($templateHelper->getStandardTemplateDefinitions() as $templateDefinition) {
                // Load parent templates transaltions, the current template translations.
                $templateList = array_merge(
                    $templateDefinition->getParentList(),
                    [ $templateDefinition ]
                );

                /** @var TemplateDefinition $tplDef */
                foreach ($templateList as $tplDef) {
                    if (is_dir($dir = $tplDef->getAbsoluteI18nPath())) {
                        $translationDirs[$tplDef->getTranslationDomain()] = $dir;
                    }
                }
            }

            if ($translationDirs) {
                $this->loadTranslation($container, $translationDirs);
            }
        }
    }
784836
public function addSemanticConfig(NodeBuilder $nodeBuilder)
    {
        $nodeBuilder
            ->arrayNode('subitems_module')
            ->info('Subitems module configuration')
            ->children()
            ->integerNode('limit')->isRequired()->defaultValue(10)->end()
            ->end()
            ->end();
    }
1356055
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder('twig');
        $rootNode = $treeBuilder->getRootNode();

        $rootNode
            ->children()
                ->scalarNode('exception_controller')->defaultValue('twig.controller.exception::showAction')->end()
            ->end()
        ;

        $this->addFormThemesSection($rootNode);
        $this->addGlobalsSection($rootNode);
        $this->addTwigOptions($rootNode);
        $this->addTwigFormatOptions($rootNode);

        return $treeBuilder;
    }
520140
public function addSemanticConfig(NodeBuilder $nodeBuilder)
    {
        $nodeBuilder
            ->arrayNode('user_content_type_identifier')
                ->info('User Content Type identifier configuration.')
                ->example(['user', 'my_custom_user_identifier'])
                ->requiresAtLeastOneElement()
                ->prototype('scalar')->end()
            ->end();
    }
557801
protected function configureKnpMenuBundle(ContainerBuilder $container)
    {
        foreach (array_keys($container->getExtensions()) as $name) {
            switch ($name) {
                case 'knp_menu':
                    $container->prependExtensionConfig(
                        $name,
                        array('twig' => array('template'  => $this->menuTemplate))
                    );
                    break;
            }
        }
    }
716846
public function addFieldTypeSemanticConfig(NodeBuilder $nodeBuilder)
    {
        $nodeBuilder
            ->arrayNode('custom_tags')
                ->info('Custom XSL stylesheets to use for XmlText transformation to HTML5. Useful for "custom tags".')
                ->example(
                    [
                        'path' => '%kernel.root_dir%/../src/Acme/TestBundle/Resources/myTag.xsl',
                        'priority' => 10,
                    ]
                )
                ->prototype('array')
                    ->children()
                        ->scalarNode('path')
                            ->info('Path of the XSL stylesheet to load.')
                            ->isRequired()
                        ->end()
                        ->integerNode('priority')
                            ->info('Priority in the loading order. A high value will have higher precedence in overriding XSL templates.')
                            ->defaultValue(0)
                        ->end()
                    ->end()
                ->end()
            ->end();
    }
96946
public function configureTwigBundle(ContainerBuilder $container, array $config)
    {
    	foreach(array_keys($container->getExtensions()) as $name) {
    		switch($name) {
    			case 'twig':
    				$container->prependExtensionConfig($name, array(
    					'form_themes' => array($config['form_theme'])
    				));
    				break;
    		}
    	}
    }