<commit_before><?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
class ConfigLoader{
    private $_sConfigFile = "";
    private $_aConfig = array();
    public function __construct($sConfigFile) {
        $this->_sConfigFile = $sConfigFile;
    }
    
    public function loadSysFile(){
        $oFile = new Util_IniFile($this->_sConfigFile);
        $this->_aConfig = $oFile->parse()->getConfig();
        $this->loadEnv();
        $this->reloadConfig();
        return $this->_aConfig;
    }

    private function loadEnv() {
        if (isset($this->_aConfig['common']["test"]["host"])) {
            $aTestServer = explode(",", $this->_aConfig['common']["test"]["host"]);
            $server_name = php_uname('n');
            if (in_array($server_name,$aTestServer)) {
                define("IDC", 'test');
            } else {
                define("IDC", 'online');
            }
        }      
        if (isset($this->_aConfig['common']["template"]["engine"])){
            if($this->_aConfig['common']["template"]["engine"] == "smarty"){
                if (isset($this->_aConfig['common']["smarty"]["dir"])) {
                    define("SMARTY_DIR", $this->_aConfig['common']["smarty"]["dir"]);
                }
            }
        }        
    }
    
    private function reloadConfig(){
        $aConfig = $this->_aConfig;
        $this->_aConfig = array_merge($aConfig["common"],$aConfig[IDC]);        
    }

}<commit_msg>修改配置信息<commit_after><?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
class ConfigLoader{
    private $_sConfigFile = "";
    private $_aConfig = array();
    public function __construct($sConfigFile) {
        $this->_sConfigFile = $sConfigFile;
    }
    
    public function loadSysFile(){
        $oFile = new Util_IniFile($this->_sConfigFile);
        $this->_aConfig = $oFile->parse()->getConfig();
        $this->loadEnv();
        $this->reloadConfig();
        return $this->_aConfig;
    }

    private function loadEnv() {
        $server_name = php_uname('n');
        if(isset($this->_aConfig['common']["data"]["host"])){
            $aTestServer = explode(",", $this->_aConfig['common']["data"]["host"]);            
            if (in_array($server_name,$aTestServer)) {
                define("IDC", 'data');
            }
        }
        if (isset($this->_aConfig['common']["test"]["host"])) {
            $aTestServer = explode(",", $this->_aConfig['common']["test"]["host"]);
            if (in_array($server_name,$aTestServer)) {
                define("IDC", 'test');
            } 
        }   
        if(!defined('IDC')){
            define("IDC", 'online');
        }
        if (isset($this->_aConfig['common']["template"]["engine"])){
            if($this->_aConfig['common']["template"]["engine"] == "smarty"){
                if (isset($this->_aConfig['common']["smarty"]["dir"])) {
                    define("SMARTY_DIR", $this->_aConfig['common']["smarty"]["dir"]);
                }
            }
        }        
    }
    
    private function reloadConfig(){
        $aConfig = $this->_aConfig;
        $this->_aConfig = array_merge($aConfig["common"],$aConfig[IDC]);        
    }

}
{'fraction_non_alphanumeric': 0.18031837916063675, 'fraction_numerical': 0.0, 'mean_word_length': 2.2977099236641223, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, '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': '5441910', 'n_tokens_mistral': 1002, 'n_tokens_neox': 1013, 'n_words': 174}