<commit_before><?php
error_reporting(E_ALL ^ ( E_NOTICE | E_STRICT | E_DEPRECATED ) );
ini_set('display_errors',true);

$args = new stdClass;
$args->url = getenv('DATABASE_URL');

if ($args->url) {
	preg_match('/^(mysql:\/\/)(.*):(.*)@(.*):([0-9]+)\/([a-z0-9\._]+)(\?sslca=(.*))?$/u', $args->url, $matches);
	$args->user = $matches[2];
	$args->pass = $matches[3];
	$args->host = $matches[4];
	$args->port = $matches[5];
	$args->db = $matches[6];
	$args->sslca = $matches[8];
}

if (!$args->dsn) {
	$args->dsn = 'mysql:host='.$args->host.';dbname='.$args->db.';charset=utf8';
}

if ($args->persistent) {
	$options[PDO::ATTR_PERSISTENT] = true;
}

if ($args->sslca) {
	$options[PDO::MYSQL_ATTR_SSL_CA] = $args->sslca;
	$options[PDO::ATTR_TIMEOUT] = 4;
	$options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
}
		
if (getenv('HEROKU')) {
	error_log('>> CONNECTING TO DATABASE...');
}

$db = new \PDO($args->dsn, $args->user, $args->pass, $options);

$this->database($args->db);

$db->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
$db->setAttribute(\PDO::ATTR_EMULATE_PREPARES, false);
$db->setAttribute(\PDO::ATTR_DEFAULT_FETCH_MODE, \PDO::FETCH_OBJ);
		
if (getenv('HEROKU')) {
	error_log('>> CONNECTED');
}


$stmt = $db->prepare($query);
$stmt->execute($args);

die('done');<commit_msg>db test<commit_after><?php
error_reporting(E_ALL ^ ( E_NOTICE | E_STRICT | E_DEPRECATED ) );
ini_set('display_errors',true);

$args = new stdClass;
$args->url = getenv('DATABASE_URL');

if ($args->url) {
	preg_match('/^(mysql:\/\/)(.*):(.*)@(.*):([0-9]+)\/([a-z0-9\._]+)(\?sslca=(.*))?$/u', $args->url, $matches);
	$args->user = $matches[2];
	$args->pass = $matches[3];
	$args->host = $matches[4];
	$args->port = $matches[5];
	$args->db = $matches[6];
	$args->sslca = $matches[8];
}

if (!$args->dsn) {
	$args->dsn = 'mysql:host='.$args->host.';dbname='.$args->db.';charset=utf8';
}

if ($args->persistent) {
	$options[PDO::ATTR_PERSISTENT] = true;
}

if ($args->sslca) {
	$options[PDO::MYSQL_ATTR_SSL_CA] = $args->sslca;
	$options[PDO::ATTR_TIMEOUT] = 4;
	$options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
}
		
if (getenv('HEROKU')) {
	error_log('>> CONNECTING TO DATABASE...');
}

$db = new \PDO($args->dsn, $args->user, $args->pass, $options);

$db->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
$db->setAttribute(\PDO::ATTR_EMULATE_PREPARES, false);
$db->setAttribute(\PDO::ATTR_DEFAULT_FETCH_MODE, \PDO::FETCH_OBJ);
		
if (getenv('HEROKU')) {
	error_log('>> CONNECTED');
}

$query = 'update session set token=? where id_session=?';
$args = [rand(1,99999), '2jvvbkeh0k4bvb38or2lo4m1s7'];

$stmt = $db->prepare($query);
$stmt->execute($args);


die('done');
{'fraction_non_alphanumeric': 0.2657943925233645, 'fraction_numerical': 0.014579439252336448, 'mean_word_length': 5.809160305343512, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 61, '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': '5646866', 'n_tokens_mistral': 1200, 'n_tokens_neox': 1167, 'n_words': 151}