<commit_before><?php
/**
 * @author jdia07
 * @copyright (c) 2015, Vainglory07 02.07
 * 
 */


if (! function_exists('base_url')) {
    /**
     * Gets the base url of the application.
     * With HTTP injection filter.
     * 
     * @return string
     */
    function baseurl() {
        // Force custom Base URL
        $protocol = (isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
        $host = trim(preg_replace('/[^a-z \d \. _]/i ', '', strip_tags($_SERVER['HTTP_HOST'])));
        $location = substr(str_replace(basename($_SERVER['SCRIPT_NAME']), "", $_SERVER['SCRIPT_NAME']), 0, -1);
        $base_url = "{$protocol}://{$host}{$location}/";
        
        return $base_url;
    }
}

if (! function_exists('set_env')) {
    /*!
     * Detect and set global project environment
     * 
     * @param array  $setup    Environment setup<commit_msg>Update helpers.php<commit_after><?php
/*!
 * @author jdia07
 * @copyright (c) 2015, Vainglory07 02.07
 */


if (! function_exists('base_url')) {
    /**
     * Gets the base url of the application.
     * With HTTP injection filter.
     * 
     * @return string
     */
    function baseurl() {
        // Force custom Base URL
        $protocol = (isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
        $host = trim(preg_replace('/[^a-z \d \. _]/i ', '', strip_tags($_SERVER['HTTP_HOST'])));
        $location = substr(str_replace(basename($_SERVER['SCRIPT_NAME']), "", $_SERVER['SCRIPT_NAME']), 0, -1);
        $base_url = "{$protocol}://{$host}{$location}/";
        
        return $base_url;
    }
}

if (! function_exists('set_env')) {
    /*!
     * Detect and set global project environment
     * 
     * @param array  $setup    Environment setup
{'fraction_non_alphanumeric': 0.18541548897682306, 'fraction_numerical': 0.01582815149802148, 'mean_word_length': 2.6419753086419755, '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': '4061778', 'n_tokens_mistral': 596, 'n_tokens_neox': 562, 'n_words': 126}