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

@@ 1411-1416 (lines=6) @@
1408
		if (file_exists($tmp_dir.'models.md5sum')) {
1409
			if ($globalDebug) echo "Check files...\n";
1410
			$newmodelsdb = array();
1411
			if (($handle = fopen($tmp_dir.'models.md5sum','r')) !== FALSE) {
1412
				while (($row = fgetcsv($handle,1000," ")) !== FALSE) {
1413
					$model = trim($row[2]);
1414
					$newmodelsdb[$model] = trim($row[0]);
1415
				}
1416
			}
1417
			if (file_exists('../models/models.md5sum')) {
1418
				if (($handle = fopen(dirname(__FILE__).'/../models/models.md5sum','r')) !== FALSE) {
1419
					while (($row = fgetcsv($handle,1000," ")) !== FALSE) {
@@ 1418-1423 (lines=6) @@
1415
				}
1416
			}
1417
			if (file_exists('../models/models.md5sum')) {
1418
				if (($handle = fopen(dirname(__FILE__).'/../models/models.md5sum','r')) !== FALSE) {
1419
					while (($row = fgetcsv($handle,1000," ")) !== FALSE) {
1420
						$model = trim($row[2]);
1421
						$modelsdb[$model] = trim($row[0]);
1422
					}
1423
				}
1424
			} else {
1425
				$modelsdb = array();
1426
			}