<commit_before><?php

namespace Fuz\AppBundle\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\Yaml\Yaml;

/**
 * This is the class that loads and manages your bundle configuration
 *
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
 */
class FuzAppExtension extends Extension
{
    /**
     * {@inheritDoc}
     */
    public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        foreach ($config as $key => $value)
        {
            if ($key !== 'container_prefix')
            {
                $container->setParameter("{$config['container_prefix']}.{$key}", $value);
            }
        }


        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.yml');
    }



}<commit_msg>loading process config when bundle boots<commit_after><?php

namespace Fuz\AppBundle\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\Yaml\Yaml;

/**
 * This is the class that loads and manages your bundle configuration
 *
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
 */
class FuzAppExtension extends Extension
{
    /**
     * {@inheritDoc}
     */
    public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        foreach ($config as $key => $value)
        {
            if ($key !== 'container_prefix')
            {
                $container->setParameter("{$config['container_prefix']}.{$key}", $value);
            }
        }

        $this->loadProcessConfig($config['process']['root_dir'], $config['process']['config_path'], $config['process']['parameters_paths'], $container);

        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.yml');
    }

    public function loadProcessConfig($rootDir, $configFile, $parameterFiles, ContainerBuilder $container)
    {
        $sluggedConfig = Yaml::parse($configFile);

        $processContainer = new ContainerBuilder();

        foreach ($parameterFiles as $parameterFile)
        {
            $locator = new FileLocator(dirname($parameterFile));
            $loader = new Loader\YamlFileLoader($processContainer, $locator);
            $loader->load(basename($parameterFile));
        }

        $processContainer->setParameter('env', $container->getParameter('kernel.environment'));
        $processContainer->setParameter('root_dir', $rootDir);
        $config = $processContainer->getParameterBag()->resolveValue($sluggedConfig);

        $container->setParameter('runner', $config);
    }

}
{'fraction_non_alphanumeric': 0.13505311077389984, 'fraction_numerical': 0.0, 'mean_word_length': 3.4661246612466123, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7390427', 'n_tokens_mistral': 880, 'n_tokens_neox': 863, 'n_words': 167}