<commit_before><?php

class EE_DB {

	private static $db;

	public function __construct() {
		if ( empty( self::$db ) ) {
			self::init_db();
		}
	}

	/**
	 * Function to initialize db and db connection.
	 */
	public static function init_db() {
		if ( ! ( file_exists( DB ) ) ) {
			self::$db = self::create();
		} else {
			self::$db = new SQLite3( DB );
			if ( ! self::$db ) {
				EE::error( self::$db->lastErrorMsg() );
			}
		}
	}

	/**
	 * Sqlite database creation.
	 */
	public static function create() {
		self::$db = new SQLite3( DB );
		$query    = "CREATE TABLE sites (
						id INTEGER NOT NULL, 
						sitename VARCHAR, 
						site_type VARCHAR, 
						site_title VARCHAR, 
						proxy_type VARCHAR, 
						cache_type VARCHAR, 
						site_path VARCHAR, 
						created_on DATETIME, 
						is_enabled BOOLEAN DEFAULT 1, 
						is_ssl BOOLEAN DEFAULT 0, 
						storage_fs VARCHAR, 
						storage_db VARCHAR, 
						db_name VARCHAR, 
						db_user VARCHAR, 
						db_password VARCHAR,
						db_root_password VARCHAR, 
						db_host VARCHAR, 
						wp_user VARCHAR, 
						wp_pass VARCHAR, 
						email VARCHAR, 
						php_version VARCHAR, 
						PRIMARY KEY (id), 
						UNIQUE (sitename), 
						CHECK (is_enabled IN (0, 1)), 
						CHECK (is_ssl IN (0, 1))
					);";
		self::$db->exec( $query );
	}

	/**
	 * Insert row in table.
	 *
	 * @param array $data in key value pair.
	 *
	 * @return bool
	 */
	public static function insert( $data ) {

		if ( empty ( self::$db ) ) {
			self::init_db();
		}

		$table_name = TABLE;<commit_msg>Add db_port field while creating database<commit_after><?php

class EE_DB {

	private static $db;

	public function __construct() {
		if ( empty( self::$db ) ) {
			self::init_db();
		}
	}

	/**
	 * Function to initialize db and db connection.
	 */
	public static function init_db() {
		if ( ! ( file_exists( DB ) ) ) {
			self::$db = self::create();
		} else {
			self::$db = new SQLite3( DB );
			if ( ! self::$db ) {
				EE::error( self::$db->lastErrorMsg() );
			}
		}
	}

	/**
	 * Sqlite database creation.
	 */
	public static function create() {
		self::$db = new SQLite3( DB );
		$query    = "CREATE TABLE sites (
						id INTEGER NOT NULL, 
						sitename VARCHAR, 
						site_type VARCHAR, 
						site_title VARCHAR, 
						proxy_type VARCHAR, 
						cache_type VARCHAR, 
						site_path VARCHAR, 
						created_on DATETIME, 
						is_enabled BOOLEAN DEFAULT 1, 
						is_ssl BOOLEAN DEFAULT 0, 
						storage_fs VARCHAR, 
						storage_db VARCHAR, 
						db_name VARCHAR, 
						db_user VARCHAR, 
						db_password VARCHAR,
						db_root_password VARCHAR, 
						db_host VARCHAR, 
						db_port VARCHAR, 
						wp_user VARCHAR, 
						wp_pass VARCHAR, 
						email VARCHAR, 
						php_version VARCHAR, 
						PRIMARY KEY (id), 
						UNIQUE (sitename), 
						CHECK (is_enabled IN (0, 1)), 
						CHECK (is_ssl IN (0, 1))
					);";
		self::$db->exec( $query );
	}

	/**
	 * Insert row in table.
	 *
	 * @param array $data in key value pair.
	 *
	 * @return bool
	 */
	public static function insert( $data ) {

		if ( empty ( self::$db ) ) {
			self::init_db();
		}

		$table_name = TABLE;
{'fraction_non_alphanumeric': 0.12309160305343511, 'fraction_numerical': 0.005089058524173028, 'mean_word_length': 2.2523267838676317, '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': '6468940', 'n_tokens_mistral': 1460, 'n_tokens_neox': 1074, 'n_words': 290}