<commit_before><?
/**
 * Estensione di Connection per Postgre SQL 
 */
class PiConnectionPostgreSQL extends PiConnection{
	

	public function connect(){
		//$this->link = pg_connect(' "host='.$this->src["server"].' user='.$this->src["dbuser"].' password='.$this->src["dbpwd"].' dbname='.$this->src["dbname"].' "');
		$this->link = pg_connect("host=localhost user=postgres password=pi dbname=Pubbligraf");		
		$this->is_connected = true;
	}
	
	public function disconnect(){
		pg_close($this->link);
		$this->is_connected = false;
	}
	
	public function get($iQry){
		$func = create_function('$key','if(!isset($key)){return("'.(str_replace('"','\\"',$this->opt["null"])).'");}else{return($key);}');
		$raw_data = pg_query($this->link,$iQry);
		$i = 0;
		$data = array();
		
		if($this->opt["associative"]){
			while($res = pg_fetch_assoc($raw_data)){
				$data[$i++] = array_map($func,$res);}
		}else{
			while($res = pg_fetch_row($raw_data)){
				
				$data[$i++] = array_map($func,$res);}
		}
		
		
		
		$this->opt['numrow'] = pg_num_rows($raw_data);
		pg_free_result($raw_data);
		return $data;
	}
	
	public function exec($iQry){
		$raw_data = pg_query($iQry);
		$this->opt['numrow'] = pg_affected_rows();//mysql_num_rows($raw_data);
	}
	
	public function __destruct(){
		if($this->is_connected===true){$this->disconnect();}
		parent::__destruct();
	}

	
}
?><commit_msg>Correzione libreria PostgreSQL<commit_after><?
/**
 * Estensione di Connection per Postgre SQL 
 */
class PiConnectionPostgreSQL extends PiConnection{
	

	public function connect(){
		$this->link = pg_connect(' "host='.$this->src["server"].' user='.$this->src["dbuser"].' password='.$this->src["<PASSWORD>"].' dbname='.$this->src["dbname"].' "');
		//$this->link = pg_connect("host=localhost user=postgres password=pi dbname=Pubbligraf");
		if($this->link === false){
			$this->error('Errore nella selezione del db del server PostgreSQL '.$this->src["server"].'\\<b>'.$this->src["dbname"].'</b>');
		}
		$this->is_connected = true;
	}
	
	public function disconnect(){
		pg_close($this->link);
		$this->is_connected = false;
	}
	
	public function get($iQry){
		$func = create_function('$key','if(!isset($key)){return("'.(str_replace('"','\\"',$this->opt["null"])).'");}else{return($key);}');
		$raw_data = pg_query($this->link,$iQry);
		if($row_data === false){
			$this->error('PostgreSQL Errore Query: '.pg_last_error()); 
		}
		$i = 0;
		$data = array();
		
		if($this->opt["associative"]){
			while($res = pg_fetch_assoc($raw_data)){
				$data[$i++] = array_map($func,$res);}
		}else{
			while($res = pg_fetch_row($raw_data)){
				
				$data[$i++] = array_map($func,$res);}
		}
		
		
		
		$this->opt['numrow'] = pg_num_rows($raw_data);
		pg_free_result($raw_data);
		return $data;
	}
	
	public function exec($iQry){
		$raw_data = pg_query($iQry);
		if($row_data === false){
			$this->error('PostgreSQL Errore Query: '.pg_last_error()); 
		}
		$this->opt['numrow'] = pg_affected_rows();//mysql_num_rows($raw_data);
	}
	
	public function __destruct(){
		if($this->is_connected===true){$this->disconnect();}
		parent::__destruct();
	}

	
}
?>
{'fraction_non_alphanumeric': 0.23353678123996144, 'fraction_numerical': 0.00064246707356248, 'mean_word_length': 4.920152091254753, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 46, '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': '4638903', 'n_tokens_mistral': 1271, 'n_tokens_neox': 1135, 'n_words': 167}