Completed
Push — master ( 0a922a...0f8d98 )
by Yannick
29:36
created
require/class.SpotterArchive.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 	/**
15 15
 	* Get SQL query part for filter used
16 16
 	* @param Array $filter the filter
17
-	* @return Array the SQL part
17
+	* @return string the SQL part
18 18
 	*/
19 19
 	public function getFilter($filter = array(),$where = false,$and = false) {
20 20
 		global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver;
Please login to merge, or discard this patch.
install/class.update_db.php 1 patch
Doc Comments   +48 added lines patch added patch discarded remove patch
@@ -10,6 +10,9 @@  discard block
 block discarded – undo
10 10
 class update_db {
11 11
 	public static $db_sqlite;
12 12
 
13
+	/**
14
+	 * @param string $file
15
+	 */
13 16
 	public static function download($url, $file, $referer = '') {
14 17
 		global $globalProxy, $globalForceIPv4;
15 18
 		$fp = fopen($file, 'w');
@@ -34,6 +37,9 @@  discard block
 block discarded – undo
34 37
 		fclose($fp);
35 38
 	}
36 39
 
40
+	/**
41
+	 * @param string $in_file
42
+	 */
37 43
 	public static function gunzip($in_file,$out_file_name = '') {
38 44
 		//echo $in_file.' -> '.$out_file_name."\n";
39 45
 		$buffer_size = 4096; // read 4kb at a time
@@ -55,6 +61,9 @@  discard block
 block discarded – undo
55 61
 		}
56 62
 	}
57 63
 
64
+	/**
65
+	 * @param string $in_file
66
+	 */
58 67
 	public static function unzip($in_file) {
59 68
 		if ($in_file != '' && file_exists($in_file)) {
60 69
 			$path = pathinfo(realpath($in_file), PATHINFO_DIRNAME);
@@ -76,6 +85,9 @@  discard block
 block discarded – undo
76 85
 		}
77 86
 	}
78 87
 	
88
+	/**
89
+	 * @param string $database_file
90
+	 */
79 91
 	public static function retrieve_route_sqlite_to_dest($database_file) {
80 92
 		global $globalDebug, $globalTransaction;
81 93
 		//$query = 'TRUNCATE TABLE routes';
@@ -118,6 +130,10 @@  discard block
 block discarded – undo
118 130
 		}
119 131
                 return '';
120 132
 	}
133
+
134
+	/**
135
+	 * @param string $database_file
136
+	 */
121 137
 	public static function retrieve_route_oneworld($database_file) {
122 138
 		global $globalDebug, $globalTransaction;
123 139
 		//$query = 'TRUNCATE TABLE routes';
@@ -159,6 +175,9 @@  discard block
 block discarded – undo
159 175
                 return '';
160 176
 	}
161 177
 	
178
+	/**
179
+	 * @param string $database_file
180
+	 */
162 181
 	public static function retrieve_route_skyteam($database_file) {
163 182
 		global $globalDebug, $globalTransaction;
164 183
 		//$query = 'TRUNCATE TABLE routes';
@@ -201,6 +220,10 @@  discard block
 block discarded – undo
201 220
 		}
202 221
                 return '';
203 222
 	}
223
+
224
+	/**
225
+	 * @param string $database_file
226
+	 */
204 227
 	public static function retrieve_modes_sqlite_to_dest($database_file) {
205 228
 		global $globalTransaction;
206 229
 		//$query = 'TRUNCATE TABLE aircraft_modes';
@@ -267,6 +290,9 @@  discard block
 block discarded – undo
267 290
 		return '';
268 291
 	}
269 292
 
293
+	/**
294
+	 * @param string $database_file
295
+	 */
270 296
 	public static function retrieve_modes_flarmnet($database_file) {
271 297
 		global $globalTransaction;
272 298
 		$Common = new Common();
@@ -337,6 +363,9 @@  discard block
 block discarded – undo
337 363
 		return '';
338 364
 	}
339 365
 
366
+	/**
367
+	 * @param string $database_file
368
+	 */
340 369
 	public static function retrieve_modes_ogn($database_file) {
341 370
 		global $globalTransaction;
342 371
 		//$query = 'TRUNCATE TABLE aircraft_modes';
@@ -406,6 +435,9 @@  discard block
 block discarded – undo
406 435
 		return '';
407 436
 	}
408 437
 
438
+	/**
439
+	 * @param string $database_file
440
+	 */
409 441
 	public static function retrieve_owner($database_file,$country = 'F') {
410 442
 		global $globalTransaction, $globalMasterSource;
411 443
 		//$query = 'TRUNCATE TABLE aircraft_modes';
@@ -1393,6 +1425,10 @@  discard block
 block discarded – undo
1393 1425
 		return '';
1394 1426
         }
1395 1427
 
1428
+	/**
1429
+	 * @param string $filename
1430
+	 * @param string $tletype
1431
+	 */
1396 1432
 	public static function tle($filename,$tletype) {
1397 1433
 		require_once(dirname(__FILE__).'/../require/class.Spotter.php');
1398 1434
 		global $tmp_dir, $globalTransaction;
@@ -1442,6 +1478,9 @@  discard block
 block discarded – undo
1442 1478
 		return '';
1443 1479
         }
1444 1480
 
1481
+	/**
1482
+	 * @param string $filename
1483
+	 */
1445 1484
 	public static function satellite_ucsdb($filename) {
1446 1485
 		global $tmp_dir, $globalTransaction;
1447 1486
 		$query = "DELETE FROM satellite";
@@ -1488,6 +1527,9 @@  discard block
 block discarded – undo
1488 1527
 		return '';
1489 1528
 	}
1490 1529
 
1530
+	/**
1531
+	 * @param string $filename
1532
+	 */
1491 1533
 	public static function satellite_celestrak($filename) {
1492 1534
 		global $tmp_dir, $globalTransaction;
1493 1535
 		$satcat_sources = array(
@@ -1815,6 +1857,9 @@  discard block
 block discarded – undo
1815 1857
 
1816 1858
 	}
1817 1859
 */
1860
+	/**
1861
+	 * @param string $filename
1862
+	 */
1818 1863
 	public static function waypoints($filename) {
1819 1864
 		//require_once(dirname(__FILE__).'/../require/class.Spotter.php');
1820 1865
 		global $tmp_dir, $globalTransaction;
@@ -1883,6 +1928,9 @@  discard block
 block discarded – undo
1883 1928
 		}
1884 1929
 	}
1885 1930
 
1931
+	/**
1932
+	 * @param string $filename
1933
+	 */
1886 1934
 	public static function ivao_airlines($filename) {
1887 1935
 		//require_once(dirname(__FILE__).'/../require/class.Spotter.php');
1888 1936
 		global $tmp_dir, $globalTransaction;
Please login to merge, or discard this patch.
require/class.Source.php 1 patch
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -110,6 +110,12 @@  discard block
 block discarded – undo
110 110
 		return $all;
111 111
 	}
112 112
 
113
+	/**
114
+	 * @param string $name
115
+	 * @param string $city
116
+	 * @param string $country
117
+	 * @param string $source
118
+	 */
113 119
 	public function addLocation($name,$latitude,$longitude,$altitude,$city,$country,$source,$logo = 'antenna.png',$type = '',$source_id = 0,$location_id = 0,$last_seen = '', $description = '') {
114 120
 		if ($last_seen == '') $last_seen = date('Y-m-d H:i:s');
115 121
 		$query = "INSERT INTO source_location (name,latitude,longitude,altitude,country,city,logo,source,type,source_id,last_seen,location_id,description) VALUES (:name,:latitude,:longitude,:altitude,:country,:city,:logo,:source,:type,:source_id,:last_seen,:location_id,:description)";
@@ -168,6 +174,9 @@  discard block
 block discarded – undo
168 174
 		}
169 175
 	}
170 176
 
177
+	/**
178
+	 * @param string $type
179
+	 */
171 180
 	public function deleteLocationByType($type) {
172 181
 		$query = "DELETE FROM source_location WHERE type = :type";
173 182
 		$query_values = array(':type' => $type);
Please login to merge, or discard this patch.
require/class.Stats.php 1 patch
Doc Comments   +35 added lines patch added patch discarded remove patch
@@ -19,6 +19,10 @@  discard block
 block discarded – undo
19 19
 		if ($this->db === null) die('Error: No DB connection. (Stats)');
20 20
 	}
21 21
 
22
+	/**
23
+	 * @param string $type
24
+	 * @param string $stats_date
25
+	 */
22 26
 	public function addLastStatsUpdate($type,$stats_date) {
23 27
 		$query = "DELETE FROM config WHERE name = :type;
24 28
 			    INSERT INTO config (name,value) VALUES (:type,:stats_date);";
@@ -1369,6 +1373,10 @@  discard block
 block discarded – undo
1369 1373
 		$all = $sth->fetchAll(PDO::FETCH_ASSOC);
1370 1374
 		return $all;
1371 1375
 	}
1376
+
1377
+	/**
1378
+	 * @param string $type
1379
+	 */
1372 1380
 	public function deleteStatsByType($type,$stats_airline = '', $filter_name = '') {
1373 1381
 		if ($filter_name == '') $filter_name = $this->filter_name;
1374 1382
 		$query = "DELETE FROM stats WHERE stats_type = :type AND stats_airline = :stats_airline AND filter_name = :filter_name";
@@ -1380,6 +1388,11 @@  discard block
 block discarded – undo
1380 1388
 			echo "error : ".$e->getMessage();
1381 1389
 		}
1382 1390
 	}
1391
+
1392
+	/**
1393
+	 * @param string $type
1394
+	 * @param string $year
1395
+	 */
1383 1396
 	public function getSumStats($type,$year,$stats_airline = '',$filter_name = '',$month = '') {
1384 1397
 		if ($filter_name == '') $filter_name = $this->filter_name;
1385 1398
 		global $globalArchiveMonths, $globalDBdriver;
@@ -1579,6 +1592,10 @@  discard block
 block discarded – undo
1579 1592
 		else return 0;
1580 1593
 	}
1581 1594
 
1595
+	/**
1596
+	 * @param string $type
1597
+	 * @param string $stats_date
1598
+	 */
1582 1599
 	public function addStat($type,$cnt,$stats_date,$stats_airline = '',$filter_name = '') {
1583 1600
 		global $globalDBdriver;
1584 1601
 		if ($filter_name == '') $filter_name = $this->filter_name;
@@ -1632,6 +1649,9 @@  discard block
 block discarded – undo
1632 1649
         }
1633 1650
         */
1634 1651
 
1652
+	/**
1653
+	 * @param string $stats_type
1654
+	 */
1635 1655
 	public function getStatsSource($stats_type,$year = '',$month = '',$day = '') {
1636 1656
 		global $globalDBdriver;
1637 1657
 		$query = "SELECT * FROM stats_source WHERE stats_type = :stats_type";
@@ -1675,6 +1695,9 @@  discard block
 block discarded – undo
1675 1695
 		return $all;
1676 1696
 	}
1677 1697
 
1698
+	/**
1699
+	 * @param string $stats_type
1700
+	 */
1678 1701
 	public function addStatSource($data,$source_name,$stats_type,$date) {
1679 1702
 		global $globalDBdriver;
1680 1703
 		if ($globalDBdriver == 'mysql') {
@@ -1690,6 +1713,10 @@  discard block
 block discarded – undo
1690 1713
 			return "error : ".$e->getMessage();
1691 1714
 		}
1692 1715
 	}
1716
+
1717
+	/**
1718
+	 * @param string $type
1719
+	 */
1693 1720
 	public function addStatFlight($type,$date_name,$cnt,$stats_airline = '',$filter_name = '') {
1694 1721
 		$query = "INSERT INTO stats_flight (stats_type,flight_date,cnt,stats_airline,filter_name) VALUES (:type,:flight_date,:cnt,:stats_airline,:filter_name)";
1695 1722
 		$query_values = array(':type' => $type,':flight_date' => $date_name,':cnt' => $cnt, ':stats_airline' => $stats_airline,':filter_name' => $filter_name);
@@ -1956,6 +1983,10 @@  discard block
 block discarded – undo
1956 1983
 			return "error : ".$e->getMessage();
1957 1984
 		}
1958 1985
 	}
1986
+
1987
+	/**
1988
+	 * @param string $type
1989
+	 */
1959 1990
 	public function deleteStatFlight($type) {
1960 1991
 		$query = "DELETE FROM stats_flight WHERE stats_type = :type";
1961 1992
 		$query_values = array(':type' => $type);
@@ -1966,6 +1997,10 @@  discard block
 block discarded – undo
1966 1997
 			return "error : ".$e->getMessage();
1967 1998
 		}
1968 1999
 	}
2000
+
2001
+	/**
2002
+	 * @param string $type
2003
+	 */
1969 2004
 	public function deleteStatAirport($type) {
1970 2005
 		$query = "DELETE FROM stats_airport WHERE stats_type = :type";
1971 2006
 		$query_values = array(':type' => $type);
Please login to merge, or discard this patch.
require/class.AIS.php 1 patch
Doc Comments   +31 added lines patch added patch discarded remove patch
@@ -68,6 +68,10 @@  discard block
 block discarded – undo
68 68
        't', 'u', 'v', 'w' // 119
69 69
     ); // char 64
70 70
     */
71
+
72
+	/**
73
+	 * @param integer $ascii
74
+	 */
71 75
 	private function asciidec_2_8bit($ascii) {
72 76
 		//only process in the following range: 48-87, 96-119
73 77
 		if ($ascii < 48) { }
@@ -93,6 +97,10 @@  discard block
 block discarded – undo
93 97
 		return(substr($bin, -6)); 
94 98
 	}
95 99
 
100
+	/**
101
+	 * @param integer $_start
102
+	 * @param integer $_size
103
+	 */
96 104
 	private function binchar($_str, $_start, $_size) {
97 105
 		//  ' ' --- '?', // 0x20 - 0x3F
98 106
 		//  '@' --- '_', // 0x40 - 0x5F
@@ -118,6 +126,10 @@  discard block
 block discarded – undo
118 126
 	}
119 127
 
120 128
 	// function for decoding the AIS Message ITU Payload
129
+
130
+	/**
131
+	 * @param string $_aisdata
132
+	 */
121 133
 	private function decode_ais($_aisdata) {
122 134
 		$ro = new stdClass(); // return object
123 135
 		$ro->cls = 0; // AIS class undefined, also indicate unparsed msg
@@ -351,6 +363,12 @@  discard block
 block discarded – undo
351 363
 		elseif ($code == 99) return 'Other Type, no additional information';
352 364
 	}
353 365
 
366
+	/**
367
+	 * @param string $_itu
368
+	 * @param integer $_len
369
+	 * @param integer $_filler
370
+	 * @param string $aux
371
+	 */
354 372
 	public function process_ais_itu($_itu, $_len, $_filler, $aux /*, $ais_ch*/) {
355 373
 		global $port; // tcpip port...
356 374
 		
@@ -371,6 +389,10 @@  discard block
 block discarded – undo
371 389
 
372 390
 	// char* - AIS \r terminated string
373 391
 	// TCP based streams which send messages in full can use this instead of calling process_ais_buf
392
+
393
+	/**
394
+	 * @param string $rawdata
395
+	 */
374 396
 	public function process_ais_raw($rawdata, $aux = '') { // return int
375 397
 		static $num_seq; // 1 to 9
376 398
 		static $seq; // 1 to 9
@@ -513,6 +535,9 @@  discard block
 block discarded – undo
513 535
 		return $lond;
514 536
 	}
515 537
 
538
+	/**
539
+	 * @param integer $max_len
540
+	 */
516 541
 	private function char2bin($name, $max_len) {
517 542
 		$len = strlen($name);
518 543
 		if ($len > $max_len) $name = substr($name,0,$max_len);
@@ -540,6 +565,9 @@  discard block
 block discarded – undo
540 565
 		return $rv.$pad;
541 566
 	}
542 567
 
568
+	/**
569
+	 * @param string $_enc
570
+	 */
543 571
 	private function mk_ais($_enc, $_part=1,$_total=1,$_seq='',$_ch='A') {
544 572
 		$len_bit = strlen($_enc);
545 573
 		$rem6 = $len_bit % 6;
@@ -593,6 +621,9 @@  discard block
 block discarded – undo
593 621
 		return $result;
594 622
 	}
595 623
 
624
+	/**
625
+	 * @param string $mmsi
626
+	 */
596 627
 	public function mmsitype($mmsi) {
597 628
 		if (strlen($mmsi) == 9) {
598 629
 			if (substr($mmsi,0,3) == '974') return 'EPIRB (Emergency Position Indicating Radio Beacon) AIS';
Please login to merge, or discard this patch.