<commit_before><?php
//die(var_dump($_SERVER));
if (file_exists($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_NAME'] != '/index.php') {
    $filename = $_SERVER['SCRIPT_FILENAME'];

    $expires = 60 * 5;
    header("Pragma: public");
    header("Cache-Control: maxage=" . $expires);
    header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $expires) . ' GMT');

    if(strtolower(substr($filename, -3)) == '.js'){
        $mime = 'text/javascript';
    }elseif(strtolower(substr($filename, -4)) == '.css'){

        $mime = 'text/css';
    }else{
        $finfo = finfo_open(FILEINFO_MIME_TYPE);
        $mime = finfo_file($finfo, $_SERVER['SCRIPT_FILENAME']);
        finfo_close($finfo);
    }
    header('Content-type: ' . $mime);

    echo file_get_contents($_SERVER['SCRIPT_FILENAME']);
    die;  // serve the requested resource as-is.
} else {
    chdir($_SERVER['DOCUMENT_ROOT']);
    include_once 'index.php';
}
<commit_msg>src/router.php<commit_after><?php

if (file_exists($_SERVER['SCRIPT_FILENAME']) && strtolower(substr($_SERVER['SCRIPT_NAME'],-4)) !== '.php') {
    $filename = $_SERVER['SCRIPT_FILENAME'];

    $expires = 60 * 5;
    header("Pragma: public");
    header("Cache-Control: maxage=" . $expires);
    header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $expires) . ' GMT');

    if(strtolower(substr($filename, -3)) == '.js'){
        $mime = 'text/javascript';
    }elseif(strtolower(substr($filename, -4)) == '.css'){

        $mime = 'text/css';
    }else{
        $finfo = finfo_open(FILEINFO_MIME_TYPE);
        $mime = finfo_file($finfo, $_SERVER['SCRIPT_FILENAME']);
        finfo_close($finfo);
    }
    header('Content-type: ' . $mime);

    echo file_get_contents($_SERVER['SCRIPT_FILENAME']);
    die;  // serve the requested resource as-is.
} else if($_SERVER['SCRIPT_NAME'] === '/index.php') {
    chdir($_SERVER['DOCUMENT_ROOT']);
    include_once 'index.php';
}else{
    return false;
}


{'fraction_non_alphanumeric': 0.20463917525773195, 'fraction_numerical': 0.005670103092783505, 'mean_word_length': 3.6214285714285714, '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': '863400', 'n_tokens_mistral': 726, 'n_tokens_neox': 683, 'n_words': 116}