<commit_before><?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

$host = filter_input(INPUT_POST, 'mysql_host', FILTER_SANITIZE_URL);
$login = filter_input(INPUT_POST, 'mysql_login', FILTER_SANITIZE_STRING);
$password = filter_input(INPUT_POST, 'mysql_password', FILTER_SANITIZE_STRING);
$database = filter_input(INPUT_POST, 'mysql_database', FILTER_SANITIZE_STRING);

$file = "configuration.php";
$mode = "w";

$fhandle = fopen($file, $mode);

if ($fhandle) {
    echo 'success/fhandle';
}
else {
    echo 'failure/fhandle';
}

$contents =
'
<?php

$mysql_host = "'.$host.'";
$mysql_database = "'.$database.'";
$mysql_user = "'.$login.'";
$mysql_password = "'.$password.'";
';

$fwrite = fwrite($fhandle, $contents);

if ($fwrite) {
    echo 'success/fwrite';
}
else {
    echo 'failure/fwrite';
}

fclose($fhandle);<commit_msg>Reverted back to outputting the result<commit_after><?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

$host = filter_input(INPUT_POST, 'mysql_host', FILTER_SANITIZE_URL);
$login = filter_input(INPUT_POST, 'mysql_login', FILTER_SANITIZE_STRING);
$password = filter_input(INPUT_POST, 'mysql_password', FILTER_SANITIZE_STRING);
$database = filter_input(INPUT_POST, 'mysql_database', FILTER_SANITIZE_STRING);

$file = "configuration.php";
$mode = "w";

$fhandle = fopen($file, $mode);

if ($fhandle) {
    echo 'success/fhandle'.PHP_EOL;
}
else {
    echo 'failure/fhandle'.PHP_EOL;
}

$contents =
'
<?php

$mysql_host = "'.$host.'";
$mysql_database = "'.$database.'";
$mysql_user = "'.$login.'";
$mysql_password = "'.$password.'";
';

echo $contents.PHP_EOL;

$fwrite = fwrite($fhandle, $contents);

if ($fwrite) {
    echo 'success/fwrite'.PHP_EOL;
}
else {
    echo 'failure/fwrite';
}

fclose($fhandle);
{'fraction_non_alphanumeric': 0.16237623762376238, 'fraction_numerical': 0.0, 'mean_word_length': 5.29595015576324, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5870922', 'n_tokens_mistral': 731, 'n_tokens_neox': 722, 'n_words': 162}