<commit_before><?php

/**
 * This file is part of the Krystal Framework
 * 
 * Copyright (c) 2015 <NAME> <<EMAIL>>
 * 
 * For the full copyright and license information, please view
 * the license file that was distributed with this source code.
 */

namespace Krystal\Db\Sql\Connector;

use PDO;

final class MySQL extends PDO
{
	/**
	 * Initializes the PDO for MySQL
	 * 
	 * @param array $params
	 * @return void
	 */
	public function __construct(array $params)
	{
		$dsn = 'mysql:host='.$params['host'];

		if (isset($params['dbname'])) {
			$dsn .= ';dbname='.$params['dbname'];
		}

		$options = array(
			parent::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES UTF8',
			parent::ATTR_ERRMODE => parent::ERRMODE_EXCEPTION,
			parent::ATTR_EMULATE_PREPARES => true,
			parent::ATTR_DEFAULT_FETCH_MODE => parent::FETCH_ASSOC,
		);

		parent::__construct($dsn, $params['username'], $params['password'], $options);
	}
}<commit_msg>Renamed to $attrs<commit_after><?php

/**
 * This file is part of the Krystal Framework
 * 
 * Copyright (c) 2015 <NAME> <<EMAIL>>
 * 
 * For the full copyright and license information, please view
 * the license file that was distributed with this source code.
 */

namespace Krystal\Db\Sql\Connector;

use PDO;

final class MySQL extends PDO
{
	/**
	 * Initializes the PDO for MySQL
	 * 
	 * @param array $params
	 * @return void
	 */
	public function __construct(array $params)
	{
		$dsn = 'mysql:host='.$params['host'];

		if (isset($params['dbname'])) {
			$dsn .= ';dbname='.$params['dbname'];
		}

		$attrs = array(
			parent::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES UTF8',
			parent::ATTR_ERRMODE => parent::ERRMODE_EXCEPTION,
			parent::ATTR_EMULATE_PREPARES => true,
			parent::ATTR_DEFAULT_FETCH_MODE => parent::FETCH_ASSOC,
		);

		parent::__construct($dsn, $params['username'], $params['password'], $attrs);
	}
}
{'fraction_non_alphanumeric': 0.15113759479956662, 'fraction_numerical': 0.005417118093174431, 'mean_word_length': 4.262108262108262, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, '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': '2261053', 'n_tokens_mistral': 686, 'n_tokens_neox': 607, 'n_words': 158}