<commit_before><?php defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * @author <NAME> <<EMAIL>>, 2013
 * @license The MIT License, http://opensource.org/licenses/MIT for my modifications.
 */

class Core_Config extends MX_Config {

    /**
     * Class constructor
     *
     * Sets the $config data from the primary config.php file as a class variable.
     *
     * @return    void
     */
    public function __construct()
    {
        $this->config =& get_config();
        log_message('debug', 'Config Class Initialized');

        global $DETECT_URL;

        // Set the base_url automatically if none was provided
        if (empty($this->config['base_url']))
        {
            $this->set_item('base_url', $DETECT_URL['base_url']);
        }

        if (!defined('BASE_URL')) {
            define('BASE_URL', $this->add_slash($this->base_url()));
        }

        if (!defined('BASE_URI')) {
            define('BASE_URI', $DETECT_URL['base_uri']);
        }

        if (!defined('SERVER_URL')) {
            define('SERVER_URL', $this->add_slash(str_replace(BASE_URI, '', BASE_URL)));
        }

        if (!defined('SITE_URL')) {
            define('SITE_URL', $this->add_slash($this->site_url()));
        }

        if (!defined('SITE_URI')) {
            define('SITE_URI', '/'.str_replace(SERVER_URL, '', SITE_URL));
        }

        if (!defined('CURRENT_URI')) {
            define('CURRENT_URI', $DETECT_URL['current_uri']);
        }

        if (!defined('CURRENT_URL')) {
            define('CURRENT_URL', rtrim(SERVER_URL, '/').CURRENT_URI);
        }
    }

    // --------------------------------------------------------------------

    /**
     * Load Config File
     *
     * @param   string  $file               Configuration file name
     * @param   bool    $use_sections       Whether configuration values should be loaded into their own section
     * @param   bool    $fail_gracefully    Whether to just return FALSE or display an error message
     * @return  bool                        TRUE if the file was loaded correctly or FALSE on failure
     */
    public function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) {

        $file = ($file === '') ? 'config' : str_replace('.php', '', $file);

        $loaded = FALSE;

        foreach ($this->_config_paths as $path) {

            foreach (array($file, ENVIRONMENT.'/'.$file) as $location) {<commit_msg>Introducing the constant IS_UTF8_CHARSET, see my issue https://github.com/EllisLab/CodeIgniter/issues/2792<commit_after><?php defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * @author <NAME> <<EMAIL>>, 2013
 * @license The MIT License, http://opensource.org/licenses/MIT for my modifications.
 */

class Core_Config extends MX_Config {

    /**
     * Class constructor
     *
     * Sets the $config data from the primary config.php file as a class variable.
     *
     * @return    void
     */
    public function __construct()
    {
        $this->config =& get_config();
        log_message('debug', 'Config Class Initialized');

        global $DETECT_URL;

        // Set the base_url automatically if none was provided
        if (empty($this->config['base_url']))
        {
            $this->set_item('base_url', $DETECT_URL['base_url']);
        }

        if (!defined('BASE_URL')) {
            define('BASE_URL', $this->add_slash($this->base_url()));
        }

        if (!defined('BASE_URI')) {
            define('BASE_URI', $DETECT_URL['base_uri']);
        }

        if (!defined('SERVER_URL')) {
            define('SERVER_URL', $this->add_slash(str_replace(BASE_URI, '', BASE_URL)));
        }

        if (!defined('SITE_URL')) {
            define('SITE_URL', $this->add_slash($this->site_url()));
        }

        if (!defined('SITE_URI')) {
            define('SITE_URI', '/'.str_replace(SERVER_URL, '', SITE_URL));
        }

        if (!defined('CURRENT_URI')) {
            define('CURRENT_URI', $DETECT_URL['current_uri']);
        }

        if (!defined('CURRENT_URL')) {
            define('CURRENT_URL', rtrim(SERVER_URL, '/').CURRENT_URI);
        }

        // Added by <NAME>, 26-DEC-2013.
        // See https://github.com/EllisLab/CodeIgniter/issues/2792
        if (!defined('IS_UTF8_CHARSET')) {
            define('IS_UTF8_CHARSET', strtolower($this->config['charset']) === 'utf-8');
        }
        //
    }

    // --------------------------------------------------------------------

    /**
     * Load Config File
     *
     * @param   string  $file               Configuration file name
     * @param   bool    $use_sections       Whether configuration values should be loaded into their own section
     * @param   bool    $fail_gracefully    Whether to just return FALSE or display an error message
     * @return  bool                        TRUE if the file was loaded correctly or FALSE on failure
     */
    public function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) {

        $file = ($file === '') ? 'config' : str_replace('.php', '', $file);

        $loaded = FALSE;

        foreach ($this->_config_paths as $path) {

            foreach (array($file, ENVIRONMENT.'/'.$file) as $location) {
{'fraction_non_alphanumeric': 0.169998096325909, 'fraction_numerical': 0.004949552636588616, 'mean_word_length': 2.074312463428906, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 29, 'https://': 2, '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': '2354333', 'n_tokens_mistral': 1525, 'n_tokens_neox': 1460, 'n_words': 350}