<commit_before><?php

if (PHP_SAPI != 'cli') {
	header("HTTP/1.0 404 Not Found");
	exit;
}

$outfile = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : $outfile = date('Y-m-d-H-i-s').'.sql';

/**
 * dummy files just so that local.conf.php doesn't complain!
 */
class Security { static function setDefaultAdmin() {} }
class Email { static function setAdminEmail() {} }

include_once dirname(__FILE__).'/../local.conf.php';

$outfile = dirname(__FILE__).'/'.$outfile;

global $databaseConfig;

switch ($databaseConfig['type']) {
	case 'MySQLDatabase':
		$u = $databaseConfig['username'];
		$p = $databaseConfig['password'];
		$h = $databaseConfig['server'];
		$d = $databaseConfig['database'];

		$cmd = "mysqldump --user=$u --password=$p --host=$host $d > ".escapeshellarg($outfile);
		exec($cmd);
		break;
	case 'SQLiteDatabase':
		$d = $databaseConfig['database'];
		$path = realpath(dirname(__FILE__).'/../../assets/.sqlitedb/'.$d);
		$cmd = "sqlite3 ".escapeshellarg($path)." .dump > ".escapeshellarg($outfile);
		exec($cmd);
		break;
	default: break;
}<commit_msg>Fixed incorrect host variable name<commit_after><?php

if (PHP_SAPI != 'cli') {
	header("HTTP/1.0 404 Not Found");
	exit;
}

$outfile = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : $outfile = date('Y-m-d-H-i-s').'.sql';

/**
 * dummy files just so that local.conf.php doesn't complain!
 */
class Security { static function setDefaultAdmin() {} }
class Email { static function setAdminEmail() {} }

include_once dirname(__FILE__).'/../local.conf.php';

$outfile = dirname(__FILE__).'/'.$outfile;

global $databaseConfig;

switch ($databaseConfig['type']) {
	case 'MySQLDatabase':
		$u = $databaseConfig['username'];
		$p = $databaseConfig['password'];
		$h = $databaseConfig['server'];
		$d = $databaseConfig['database'];

		$cmd = "mysqldump --user=$u --password=$p --host=$h $d > ".escapeshellarg($outfile);
		exec($cmd);
		break;
	case 'SQLiteDatabase':
		$d = $databaseConfig['database'];
		$path = realpath(dirname(__FILE__).'/../../assets/.sqlitedb/'.$d);
		$cmd = "sqlite3 ".escapeshellarg($path)." .dump > ".escapeshellarg($outfile);
		exec($cmd);
		break;
	default: break;
}
{'fraction_non_alphanumeric': 0.21686746987951808, 'fraction_numerical': 0.0074142724745134385, 'mean_word_length': 4.696569920844327, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '1667578', 'n_tokens_mistral': 791, 'n_tokens_neox': 753, 'n_words': 152}