<commit_before><?php

function activerecord_load($application_name)
{
    include_once 'php-activerecord/ActiveRecord.php';

    $config = array();

    if (is_file(ENGINE_PATH.'/config/db.php'))
    {
        $config = array_merge($config, include ENGINE_PATH.'/config/db.php');
    }
    if (is_file(ENGINE_PATH.'/config/'.APPLICATION_ENV.'/db.php'))
    {
        $config = array_merge($config, include ENGINE_PATH.'/config/'.APPLICATION_ENV.'/db.php');
    }
    if (is_file(APPLICATIONS_PATH.'/'.$application_name.'/config/db.php'))
    {
        $config = array_merge($config, include APPLICATIONS_PATH.'/'.$application_name.'/config/db.php');
    }
    if (is_file(APPLICATIONS_PATH.'/'.$application_name.'/config/'.APPLICATION_ENV.'/db.php'))
    {
        $config = array_merge($config, include APPLICATIONS_PATH.'/'.$application_name.'/config/'.APPLICATION_ENV.'/db.php');
    }

    if ( ! empty($config) and ! empty($config['connection']))
    {
        $cfg = ActiveRecord\Config::instance();
        $cfg->set_model_directory(APPLICATIONS_PATH.'/'.$application_name.'/classes/model');
        $cfg->set_connections(
            array(
                'development' => $config['connection']
            )
        );
    }
}<commit_msg>fixed activerecord bootstrap<commit_after><?php

function activerecord_load($application_name)
{
    include_once 'php-activerecord/ActiveRecord.php';

    $config = array();

    if (is_file(ENGINE_PATH.'/config/db.php'))
    {
        $config = array_merge($config, include ENGINE_PATH.'/config/db.php');
    }
    if (is_file(ENGINE_PATH.'/config/'.APPLICATION_ENV.'/db.php'))
    {
        $config = array_merge($config, include ENGINE_PATH.'/config/'.APPLICATION_ENV.'/db.php');
    }
    if (is_file(APPLICATIONS_PATH.'/'.$application_name.'/config/db.php'))
    {
        $config = array_merge($config, include APPLICATIONS_PATH.'/'.$application_name.'/config/db.php');
    }
    if (is_file(APPLICATIONS_PATH.'/'.$application_name.'/config/'.APPLICATION_ENV.'/db.php'))
    {
        $config = array_merge($config, include APPLICATIONS_PATH.'/'.$application_name.'/config/'.APPLICATION_ENV.'/db.php');
    }

    if ( ! empty($config) and ! empty($config['connection']))
    {
        $cfg = ActiveRecord\Config::instance();
        $cfg->set_model_directory(APPLICATIONS_PATH.'/'.$application_name.'/models');
        $cfg->set_connections(
            array(
                'development' => $config['connection']
            )
        );
    }
}
{'fraction_non_alphanumeric': 0.17771565495207667, 'fraction_numerical': 0.0, 'mean_word_length': 3.0403225806451615, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '3852976', 'n_tokens_mistral': 845, 'n_tokens_neox': 808, 'n_words': 86}