<commit_before><?php

// TODO Secure

require_once __DIR__.'/phoenix.php';

if (
	isset($_POST['process']) &&
	$_POST['process'] == 'setup' &&
	$settings['db_reset']
) {

	// MySQL Setup

	require_once __DIR__.'/once.db.connect.php';
	$success = true;

	$result = mysqli_query($connection, 'DROP TABLE IF EXISTS `'.$settings['db_prefix'].'peers`');
	if ( !$result ) {
		echo mysqli_error($connection);
		$success = false;
	}
	$result = mysqli_query($connection, 'DROP TABLE IF EXISTS `'.$settings['db_prefix'].'tasks`');
	if ( !$result ) {
		echo mysqli_error($connection);
		$success = false;
	}
	$result = mysqli_query($connection, 'DROP TABLE IF EXISTS `'.$settings['db_prefix'].'torrents`');
	if ( !$result ) {
		echo mysqli_error($connection);
		$success = false;
	}
	$result = mysqli_query($connection,
		'CREATE TABLE IF NOT EXISTS `'.$settings['db_prefix'].'peers` (' .
			'`info_hash` varchar(40) NOT NULL,' .
			'`peer_id` varchar(40) NOT NULL,' .
			'`compact` varchar(12) NOT NULL,' .
			'`ip` char(15) NOT NULL,' .
			'`port` smallint(5) unsigned NOT NULL,' .<commit_msg>After closer reading of the spec, v4 and v6 can use different ports. Add DB field to handle this<commit_after><?php

// TODO Secure

require_once __DIR__.'/phoenix.php';

if (
	isset($_POST['process']) &&
	$_POST['process'] == 'setup' &&
	$settings['db_reset']
) {

	// MySQL Setup

	require_once __DIR__.'/once.db.connect.php';
	$success = true;

	$result = mysqli_query($connection, 'DROP TABLE IF EXISTS `'.$settings['db_prefix'].'peers`');
	if ( !$result ) {
		echo mysqli_error($connection);
		$success = false;
	}
	$result = mysqli_query($connection, 'DROP TABLE IF EXISTS `'.$settings['db_prefix'].'tasks`');
	if ( !$result ) {
		echo mysqli_error($connection);
		$success = false;
	}
	$result = mysqli_query($connection, 'DROP TABLE IF EXISTS `'.$settings['db_prefix'].'torrents`');
	if ( !$result ) {
		echo mysqli_error($connection);
		$success = false;
	}
	$result = mysqli_query($connection,
		'CREATE TABLE IF NOT EXISTS `'.$settings['db_prefix'].'peers` (' .
			'`info_hash` varchar(40) NOT NULL,' .
			'`peer_id` varchar(40) NOT NULL,' .
			'`compact` varchar(12) NOT NULL,' .
			'`ip` char(15) NOT NULL,' .
			'`ip6` char(39) NOT NULL DEFAULT \'0\',' .
			'`port` smallint(5) unsigned NOT NULL,' .
			'`port6` smallint(5) unsigned NOT NULL,' .
{'fraction_non_alphanumeric': 0.19120785317968417, 'fraction_numerical': 0.011096884336320957, 'mean_word_length': 4.413394919168591, 'pattern_counts': {'":': 0, '<': 5, '<?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': '697267', 'n_tokens_mistral': 927, 'n_tokens_neox': 850, 'n_words': 197}