<commit_before><?php
namespace core;

use \core\util\Strings;

/**
 * Config Writer
 * 
 * @author rogeriolino
 */
class ConfigWriter {

    const CONFIG_LAYOUT = '<?php
namespace {namespace};
/* Arquivo de configuracao gerado automaticamente via {generator} */
class Config {
    const IS_DEV = false;
    const SGA_INSTALLED = true;
    const DB_TYPE = "{db_type}";
    const DB_HOST = "{db_host}";
    const DB_PORT = "{db_port}";
    const DB_USER = "{db_user}";
    const DB_PASS = "{db_pass}";
    const DB_NAME = "{db_name}";
}
';
    
    public static function write(array $values) {
        $values['namespace'] = __NAMESPACE__;
        $values['generator'] = 'ConfigWriter';
        $config = Strings::format(self::CONFIG_LAYOUT, $values);
        // atualizando o arquivo de configuracao
        file_put_contents(self::filename(), $config);
    }
    
    public static function filename() {
        return dirname(__FILE__) . DS . 'Config.php';
    }

}<commit_msg>Deixando doctrine como debug temporariamente.<commit_after><?php
namespace core;

use \core\util\Strings;

/**
 * Config Writer
 * 
 * @author rogeriolino
 */
class ConfigWriter {

    const CONFIG_LAYOUT = '<?php
namespace {namespace};
/* Arquivo de configuracao gerado automaticamente via {generator} */
class Config {
    const IS_DEV = true;
    const SGA_INSTALLED = true;
    const DB_TYPE = "{db_type}";
    const DB_HOST = "{db_host}";
    const DB_PORT = "{db_port}";
    const DB_USER = "{db_user}";
    const DB_PASS = "{db_pass}";
    const DB_NAME = "{db_name}";
}
';
    
    public static function write(array $values) {
        $values['namespace'] = __NAMESPACE__;
        $values['generator'] = 'ConfigWriter';
        $config = Strings::format(self::CONFIG_LAYOUT, $values);
        // atualizando o arquivo de configuracao
        file_put_contents(self::filename(), $config);
    }
    
    public static function filename() {
        return dirname(__FILE__) . DS . 'Config.php';
    }

}
{'fraction_non_alphanumeric': 0.13423831070889894, 'fraction_numerical': 0.0, 'mean_word_length': 3.1458333333333335, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '4522050', 'n_tokens_mistral': 641, 'n_tokens_neox': 637, 'n_words': 156}