<commit_before><?php

namespace Ojs\InstallerBundle\Controller;

use Ojs\InstallerBundle\Entity\Config;
use Ojs\InstallerBundle\Form\ConfigType;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\DependencyInjection\Dumper\YamlDumper;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Yaml\Parser;
use Unifik\DatabaseConfigBundle\Entity\Parameter;
use Doctrine\Common\Persistence\ObjectManager;

class ConfigController extends Controller {

    public function configureAction(Request $request) {
        $data=[];
        $data['data']['page'] = 'config';
        $parametersFile = dirname($request->server->get('DOCUMENT_ROOT').'../')
            .'/app/config/parameters.yml';
        $parametersFileDist = $parametersFile.'.dist';
        $formData = new Config();
        $parser = new Parser();
        if(file_exists($parametersFile)){
            $formDataFile = $parser->parse(file_get_contents($parametersFile));
        }else{
            $formDataFile = $parser->parse(file_get_contents($parametersFileDist));

        }
        foreach($formDataFile['parameters'] as $key=>$value){
            $setter = 'set'.join('',array_map(function($s){return ucfirst($s);},explode('_',$key)));
            $formData->{$setter}($value);
        }
        $form = $this->createForm(new ConfigType(),$formData,[]);
        $data['form'] = $form->createView();
        return $this->render("OjsInstallerBundle:Default:configure.html.twig", $data);
    }

}<commit_msg>GLOBAL BANG<commit_after><?php

namespace Ojs\InstallerBundle\Controller;

use Ojs\InstallerBundle\Entity\Config;
use Ojs\InstallerBundle\Form\ConfigType;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\DependencyInjection\Dumper\YamlDumper;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Yaml\Parser;
use Unifik\DatabaseConfigBundle\Entity\Parameter;
use Doctrine\Common\Persistence\ObjectManager;

class ConfigController extends Controller {

    public function configureAction(Request $request) {
        $data=[];
        $data['data']['page'] = 'config';
        $parametersFile = __DIR__.'/../../../../app/config/parameters.yml';
        $parametersFileDist = $parametersFile.'.dist';
        $formData = new Config();
        $parser = new Parser();
        if(file_exists($parametersFile)){
            $formDataFile = $parser->parse(file_get_contents($parametersFile));
        }else{
            $formDataFile = $parser->parse(file_get_contents($parametersFileDist));

        }
        foreach($formDataFile['parameters'] as $key=>$value){
            $setter = 'set'.join('',array_map(function($s){return ucfirst($s);},explode('_',$key)));
            $formData->{$setter}($value);
        }
        $form = $this->createForm(new ConfigType(),$formData,[]);
        $data['form'] = $form->createView();
        return $this->render("OjsInstallerBundle:Default:configure.html.twig", $data);
    }

}
{'fraction_non_alphanumeric': 0.1535242999678146, 'fraction_numerical': 0.0, 'mean_word_length': 3.909952606635071, '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': '2138482', 'n_tokens_mistral': 905, 'n_tokens_neox': 896, 'n_words': 128}