<commit_before><?php
    $dir = "WritingsArchive";
    if(!is_dir(dir)) {
        mkdir($dir);
    }

    $writing = $_POST["text"];
    $email = $_POST["email"];
    
    $hash = hash("md5", $writing);

    if(file_put_contents($dir."/".$hash, $writing)) {
        echo "success";
    }
?><commit_msg>DATABASE DATAbSE LIVING in the DATABASE OH OOHHHHH<commit_after><?php
$dir = "WritingsArchive";
if(!is_dir(dir)) {
    mkdir($dir);
}

$writing = $_POST["text"];
$email = $_POST["email"];

//generate unique hash for writing
$hash = hash("md5", $writing);

//write essay to file
file_put_contents($dir."/".$hash, $writing);

//save email and hash to SQL//
$servername = "localhost";
$username = "root";
$password = file_get_contents("SQLPwKey.txt");
$password = substr($password, 0, strlen($password)-1);

//create connection
$conn = mysql_connect($servername, $username, $password);
//Check connection
if(!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}

//Create Database
$sql = "CREATE DATABASE IF NOT EXISTS essaysDB";
mysqli_query($conn, $sql);

//Create table
$sql = "CREATE TABLE IF NOT EXISTS Essays (
email VARCHAR(254),
hash VARCHAR(32)
)";
mysqli_query($conn, $sql);

//Insert Data
$sql = "INSERT INTO Essays (email, hash)
VALUES (".$email.",".$hash.")";
mysqli_query($conn, $sql);


//close connection
mysqli_close($conn);

?>
{'fraction_non_alphanumeric': 0.19205298013245034, 'fraction_numerical': 0.006622516556291391, 'mean_word_length': 4.418326693227091, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '185861', 'n_tokens_mistral': 494, 'n_tokens_neox': 471, 'n_words': 115}