Code Duplication    Length = 9-12 lines in 4 locations

install/class.update_schema.php 2 locations

@@ 179-188 (lines=10) @@
176
    		$error = '';
177
    		// Create table acars_label
178
		$error .= create_db::import_file('../db/acars_label.sql');
179
		if ($error == '') {
180
		    // Update schema_version to 5
181
		    $query = "UPDATE `config` SET `value` = '5' WHERE `name` = 'schema_version'";
182
        	    try {
183
            		$sth = $Connection->db->prepare($query);
184
			$sth->execute();
185
    		    } catch(PDOException $e) {
186
			return "error (update schema_version) : ".$e->getMessage()."\n";
187
    		    }
188
    		}
189
		return $error;
190
	}
191
@@ 742-753 (lines=12) @@
739
    		$Connection = new Connection();
740
		$error = '';
741
		// Add table stats polar
742
		if ($globalDBdriver == 'mysql') {
743
			//$error .= create_db::import_file('../db/stats_source.sql');
744
		} else {
745
			//$error .= create_db::import_file('../db/pgsql/stats_source.sql');
746
			$query = "create index flightaware_id_idx ON spotter_archive USING btree(flightaware_id)";
747
        		try {
748
		    		$sth = $Connection->db->prepare($query);
749
				$sth->execute();
750
			} catch(PDOException $e) {
751
				return "error (create index on spotter_archive) : ".$e->getMessage()."\n";
752
			}
753
		}
754
    		$query = "";
755
        	try {
756
			$sth = $Connection->db->prepare($query);

install/class.update_db.php 2 locations

@@ 1027-1035 (lines=9) @@
1024
		global $tmp_dir, $globalDBdriver;
1025
		include_once('class.create_db.php');
1026
		$Connection = new Connection();
1027
		if ($Connection->tableExists('airspace')) {
1028
			$query = 'DROP TABLE airspace';
1029
			try {
1030
				$sth = $Connection->db->prepare($query);
1031
                    		$sth->execute();
1032
	                } catch(PDOException $e) {
1033
				return "error : ".$e->getMessage();
1034
	                }
1035
	        }
1036
1037
1038
		if ($globalDBdriver == 'mysql') update_db::gunzip('../db/airspace.sql.gz',$tmp_dir.'airspace.sql');
@@ 1065-1073 (lines=9) @@
1062
		global $tmp_dir, $globalDBdriver;
1063
		include_once('class.create_db.php');
1064
		$Connection = new Connection();
1065
		if ($Connection->tableExists('countries')) {
1066
			$query = 'DROP TABLE countries';
1067
			try {
1068
				$sth = $Connection->db->prepare($query);
1069
            	        	$sth->execute();
1070
	                } catch(PDOException $e) {
1071
    	                	echo "error : ".$e->getMessage();
1072
	                }
1073
		}
1074
		if ($globalDBdriver == 'mysql') {
1075
			update_db::gunzip('../db/countries.sql.gz',$tmp_dir.'countries.sql');
1076
		} else {