<commit_before><?php
error_reporting(E_ALL);

require('app/config.php');

/**
 * Set unset configs
 */
if (empty($_base_url)) {
    $_base_url = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME']).'/';
}

/*
 * Helper implementation
 */
function load_helper($helper) {
    $helper_file = APPPATH . 'helpers/'.$helper.'.php';
    if (is_file($helper_file)) {
        include_once($helper_file);
    }
    else {
        include_once(SYSPATH . 'helpers/'.$helper.'.php');
    }
}

/*
 * Load common helpers
 */
load_helper('base_url');

/*
 * Load system
 */
require(SYSPATH . 'router.php');
require(SYSPATH . 'controller.php');
require(SYSPATH . 'model.php');
require(SYSPATH . 'library.php');

/*
 * Understand URL and decompose route
 */<commit_msg>Better base_path detection<commit_after><?php
error_reporting(E_ALL);

require('app/config.php');

/**
 * Set unset configs
 */
if (empty($_base_url)) {
    $_REQUEST_SCHEME = (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off') ? 'https' : 'http';
    $_PATH = dirname($_SERVER['SCRIPT_NAME']);
    if (substr($_PATH, -1) != '/') $_PATH .= '/';
    $_base_url = $_REQUEST_SCHEME.'://'.$_SERVER['HTTP_HOST'].$_PATH;
}

/*
 * Helper implementation
 */
function load_helper($helper) {
    $helper_file = APPPATH . 'helpers/'.$helper.'.php';
    if (is_file($helper_file)) {
        include_once($helper_file);
    }
    else {
        include_once(SYSPATH . 'helpers/'.$helper.'.php');
    }
}

/*
 * Load common helpers
 */
load_helper('base_url');

/*
 * Load system
 */
require(SYSPATH . 'router.php');
require(SYSPATH . 'controller.php');
require(SYSPATH . 'model.php');
require(SYSPATH . 'library.php');

/*
 * Understand URL and decompose route
 */
{'fraction_non_alphanumeric': 0.2061503416856492, 'fraction_numerical': 0.0005694760820045558, 'mean_word_length': 3.761517615176152, 'pattern_counts': {'":': 0, '<': 5, '<?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': '710226', 'n_tokens_mistral': 621, 'n_tokens_neox': 623, 'n_words': 98}