Code Duplication    Length = 6-9 lines in 3 locations

live-czml.php 1 location

@@ 117-125 (lines=9) @@
114
115
$modelsdb = array();
116
if (file_exists('models/modelsdb')) {
117
	if (($handle = fopen('models/modelsdb','r')) !== FALSE) {
118
		while (($row = fgetcsv($handle,1000)) !== FALSE) {
119
			if (isset($row[1]) ){
120
				$model = $row[0];
121
				$modelsdb[$model] = $row[1];
122
			}
123
		}
124
		fclose($handle);
125
	}
126
}
127
$j = 0;
128
$prev_flightaware_id = '';

install/class.update_db.php 2 locations

@@ 1518-1523 (lines=6) @@
1515
		if (file_exists($tmp_dir.'models.md5sum')) {
1516
			if ($globalDebug) echo "Check files...\n";
1517
			$newmodelsdb = array();
1518
			if (($handle = fopen($tmp_dir.'models.md5sum','r')) !== FALSE) {
1519
				while (($row = fgetcsv($handle,1000," ")) !== FALSE) {
1520
					$model = trim($row[2]);
1521
					$newmodelsdb[$model] = trim($row[0]);
1522
				}
1523
			}
1524
			if (file_exists(dirname(__FILE__).'../models/models.md5sum')) {
1525
				if (($handle = fopen(dirname(__FILE__).'/../models/models.md5sum','r')) !== FALSE) {
1526
					while (($row = fgetcsv($handle,1000," ")) !== FALSE) {
@@ 1525-1530 (lines=6) @@
1522
				}
1523
			}
1524
			if (file_exists(dirname(__FILE__).'../models/models.md5sum')) {
1525
				if (($handle = fopen(dirname(__FILE__).'/../models/models.md5sum','r')) !== FALSE) {
1526
					while (($row = fgetcsv($handle,1000," ")) !== FALSE) {
1527
						$model = trim($row[2]);
1528
						$modelsdb[$model] = trim($row[0]);
1529
					}
1530
				}
1531
			} else {
1532
				$modelsdb = array();
1533
			}