<commit_before><?php

// Load the configuration //
include "config.php";

// **** GLOBAL DATABASE VARIABLE **** //
$db = null;

// Logging function specific to database operations //
function db_log( $msg ) {
	error_log( "LD-CMW DB ERROR: " . $msg );
	echo "<strong>LD-CMW DB ERROR:</strong> " . $msg;
}

// Check database config //
if ( !isset($cfg_db_host) ) {
	db_log( "No database host name set." );
}
if ( !isset($cfg_db_name) ) {
	db_log( "No database name set." );
}
if ( !isset($cfg_db_login) ) {
	db_log( "No database login set." );
}
if ( !isset($cfg_db_password) ) {
	db_log( "No database password set." );
}

// Connect to the Database //
function db_init() {
	if ( !$db ) {
		$db = new mysqli($cfg_db_host,$cfg_db_name,$cfg_db_login,$cfg_db_password);
		
		// http://php.net/manual/en/mysqli.quickstart.connections.php
		if ($db->connect_errno) {
    		db_log( "Failed to connect to MySQL: (" . $db->connect_errno . ") " . $db->connect_error );
    	}
	}
	else {
		db_log( "Database connection already initialized" );<commit_msg>tweaking the config<commit_after><?php

// Load the configuration //
include "../config.php";

// **** GLOBAL DATABASE VARIABLE **** //
$db = null;

// Logging function specific to database operations //
function db_log( $msg ) {
	error_log( "LD-CMW DB ERROR: " . $msg );
	echo "<strong>LD-CMW DB ERROR:</strong> " . $msg;
}

// Check database config //
if ( !isset($cfg_db_host) ) {
	db_log( "No database host name set." );
}
if ( !isset($cfg_db_name) ) {
	db_log( "No database name set." );
}
if ( !isset($cfg_db_login) ) {
	db_log( "No database login set." );
}
if ( !isset($cfg_db_password) ) {
	db_log( "No database password set." );
}

// Connect to the Database //
function db_init() {
	if ( db_isReady() ) {
		$db = new mysqli($cfg_db_host,$cfg_db_name,$cfg_db_login,$cfg_db_password);
		
		// http://php.net/manual/en/mysqli.quickstart.connections.php
		if ($db->connect_errno) {
    		db_log( "Failed to connect to MySQL: (" . $db->connect_errno . ") " . $db->connect_error );
    	}
	}
	else {
		db_log( "Database connection already initialized" );
{'fraction_non_alphanumeric': 0.17943836268443597, 'fraction_numerical': 0.0, 'mean_word_length': 3.4914529914529915, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '6750334', 'n_tokens_mistral': 791, 'n_tokens_neox': 766, 'n_words': 182}