<commit_before><?php
if (isset($_GET['type']) and ($_GET['type'] == 'sqlite3' or $_GET['type'] == 'mysql')) {
    if ($_GET['type'] == 'sqlite3') {
        $connexion = new PDO('sqlite:./database.sqlite3');
        file_put_contents("./bdd.php", '<?php
try {
    $connexion = new PDO("sqlite:./database.sqlite3;charset=utf8");
    $connexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
    echo $e->getMessage();
}');
    }
    elseif ($_GET['type'] == 'mysql') {
        if (isset($_POST['username']) AND !empty($_POST['username']) AND !empty($_POST['pwd'])) {
            $connexion = new PDO("mysql:host=$hostname;dbname=URLShortener", $_POST['username'], $_POST['pwd']);
            file_put_contents("./bdd.php", '<?php
$hostname = \'localhost\';
$username = \'' . $_POST['username'] . '\';
$password = \'' . $_POST['pwd'] . '\';
try {
$connexion = new PDO("mysql:host=$hostname;dbname=URLShortener;charset=utf8", $username, $password);
$connexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);<commit_msg>not charset utf-8 for sqlite<commit_after><?php
if (isset($_GET['type']) and ($_GET['type'] == 'sqlite3' or $_GET['type'] == 'mysql')) {
    if ($_GET['type'] == 'sqlite3') {
        $connexion = new PDO('sqlite:./database.sqlite3');
        file_put_contents("./bdd.php", '<?php
try {
    $connexion = new PDO("sqlite:./database.sqlite3");
    $connexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
    echo $e->getMessage();
}');
    }
    elseif ($_GET['type'] == 'mysql') {
        if (isset($_POST['username']) AND !empty($_POST['username']) AND !empty($_POST['pwd'])) {
            $connexion = new PDO("mysql:host=$hostname;dbname=URLShortener", $_POST['username'], $_POST['pwd']);
            file_put_contents("./bdd.php", '<?php
$hostname = \'localhost\';
$username = \'' . $_POST['username'] . '\';
$password = \'' . $_POST['pwd'] . '\';
try {
$connexion = new PDO("mysql:host=$hostname;dbname=URLShortener;charset=utf8", $username, $password);
$connexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
{'fraction_non_alphanumeric': 0.23427230046948358, 'fraction_numerical': 0.005633802816901409, 'mean_word_length': 4.728494623655914, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5853151', 'n_tokens_mistral': 755, 'n_tokens_neox': 763, 'n_words': 119}