<commit_before><?php

ob_start();

/**
 * Initialize some variables
 */
$view_data = array();
$title = '';
$description = '';
$css_files = array('header' => array(), 'footer' => array());
$js_files = array('header' => array(), 'footer' => array());

include('config.php');

include('routing.php');

require('functions.php');

// Load the controller
include(__DIR__ . DIRECTORY_SEPARATOR . $controller);

// Stop execution if there's no view
if(empty($view)) {
	exit;
}

// Don't try to load a non existant view
if(!is_file(__DIR__ . DIRECTORY_SEPARATOR . "views" . DIRECTORY_SEPARATOR . "$view.php")) {
	$view = '404';
}

include(__DIR__ . DIRECTORY_SEPARATOR ."views" . DIRECTORY_SEPARATOR ."header.php");

extract($view_data);
include(__DIR__ . DIRECTORY_SEPARATOR ."views" . DIRECTORY_SEPARATOR ."$view.php");

include(__DIR__ . DIRECTORY_SEPARATOR ."views" . DIRECTORY_SEPARATOR ."footer.php");

ob_end_flush();
<commit_msg>Update index with latest changes from basic-php-project.<commit_after><?php

ob_start();

/**
 * Initialize some variables
 */
$view_data = array();
$title = '';
$description = '';
$css_files = array('header' => array(), 'footer' => array());
$js_files = array('header' => array(), 'footer' => array());

include('config.php');

include('routing.php');

require('functions.php');

// Load the controller
$extra = include(__DIR__ . DIRECTORY_SEPARATOR . $controller);

if(isset($extra['response_type'])){
	switch($extra['response_type']) {
		case 'json':
			header('Content-type: application/json');
			echo $extra['response'];
			break;
		case 'file':
			break;
		case 'html':
			// There should be a $view defined
		default:
			break;
	}
}

// Stop execution if there's no view
if(empty($view)) {
	exit;
}

// Don't try to load a non existant view
if(!is_file(__DIR__ . DIRECTORY_SEPARATOR . "views" . DIRECTORY_SEPARATOR . "$view.php")) {
	$view = '404';
}

if(isset($extra['no_header']) OR !$extra['no_header']) {
	include(__DIR__ . DIRECTORY_SEPARATOR ."views" . DIRECTORY_SEPARATOR ."header.php");
}

extract($view_data);
include(__DIR__ . DIRECTORY_SEPARATOR ."views" . DIRECTORY_SEPARATOR ."$view.php");
if(isset($extra['no_footer']) OR !$extra['no_footer']) {
	include(__DIR__ . DIRECTORY_SEPARATOR ."views" . DIRECTORY_SEPARATOR ."footer.php");
}


ob_end_flush();

{'fraction_non_alphanumeric': 0.18722849695916594, 'fraction_numerical': 0.0026064291920069507, 'mean_word_length': 4.9818181818181815, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '1480892', 'n_tokens_mistral': 815, 'n_tokens_neox': 775, 'n_words': 171}