@@ -179,6 +179,10 @@ discard block |
||
179 | 179 | return 1; |
180 | 180 | } |
181 | 181 | |
182 | + /** |
|
183 | + * @param double $lat |
|
184 | + * @param integer $isodd |
|
185 | + */ |
|
182 | 186 | public function cprN($lat,$isodd) { |
183 | 187 | $nl = $this->cprNL($lat) - $isodd; |
184 | 188 | if ($nl > 1) return $nl; |
@@ -186,6 +190,10 @@ discard block |
||
186 | 190 | } |
187 | 191 | |
188 | 192 | |
193 | + /** |
|
194 | + * @param string $msg |
|
195 | + * @param string $bin |
|
196 | + */ |
|
189 | 197 | function parityCheck($msg, $bin) { |
190 | 198 | $modes_checksum_table = array( |
191 | 199 | 0x3935ea, 0x1c9af5, 0xf1b77e, 0x78dbbf, 0xc397db, 0x9e31e9, 0xb0e2f0, 0x587178, |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | /** |
16 | 16 | * Get SQL query part for filter used |
17 | 17 | * @param Array $filter the filter |
18 | - * @return Array the SQL part |
|
18 | + * @return string the SQL part |
|
19 | 19 | */ |
20 | 20 | public function getFilter($filter = array(),$where = false,$and = false) { |
21 | 21 | global $globalFilter, $globalStatsFilters, $globalFilterName; |
@@ -8717,6 +8717,7 @@ discard block |
||
8717 | 8717 | /** |
8718 | 8718 | * Counts all hours |
8719 | 8719 | * |
8720 | + * @param string $orderby |
|
8720 | 8721 | * @return Array the hour list |
8721 | 8722 | * |
8722 | 8723 | */ |
@@ -8782,6 +8783,7 @@ discard block |
||
8782 | 8783 | /** |
8783 | 8784 | * Counts all hours |
8784 | 8785 | * |
8786 | + * @param string $orderby |
|
8785 | 8787 | * @return Array the hour list |
8786 | 8788 | * |
8787 | 8789 | */ |
@@ -9594,7 +9596,7 @@ discard block |
||
9594 | 9596 | /** |
9595 | 9597 | * Parses the direction degrees to working |
9596 | 9598 | * |
9597 | - * @param Float $direction the direction in degrees |
|
9599 | + * @param integer $direction the direction in degrees |
|
9598 | 9600 | * @return Array the direction information |
9599 | 9601 | * |
9600 | 9602 | */ |
@@ -40,6 +40,10 @@ |
||
40 | 40 | } |
41 | 41 | } |
42 | 42 | |
43 | + /** |
|
44 | + * @param string $id |
|
45 | + * @param string $ident |
|
46 | + */ |
|
43 | 47 | public function get_Schedule($id,$ident) { |
44 | 48 | global $globalDebug, $globalFork, $globalSchedulesFetch; |
45 | 49 | // Get schedule here, so it's done only one time |
@@ -14,7 +14,7 @@ |
||
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; |
@@ -125,6 +125,9 @@ discard block |
||
125 | 125 | public $tag_start = 0; |
126 | 126 | private $dom = null; |
127 | 127 | |
128 | + /** |
|
129 | + * @param simple_html_dom $dom |
|
130 | + */ |
|
128 | 131 | function __construct($dom) |
129 | 132 | { |
130 | 133 | $this->dom = $dom; |
@@ -1501,6 +1504,11 @@ discard block |
||
1501 | 1504 | } |
1502 | 1505 | |
1503 | 1506 | // parse attributes |
1507 | + |
|
1508 | + /** |
|
1509 | + * @param simple_html_dom_node $node |
|
1510 | + * @param string[] $space |
|
1511 | + */ |
|
1504 | 1512 | protected function parse_attr($node, $name, &$space) |
1505 | 1513 | { |
1506 | 1514 | // Per sourceforge: http://sourceforge.net/tracker/?func=detail&aid=3061408&group_id=218559&atid=1044037 |
@@ -1538,6 +1546,11 @@ discard block |
||
1538 | 1546 | } |
1539 | 1547 | |
1540 | 1548 | // link node's parent |
1549 | + |
|
1550 | + /** |
|
1551 | + * @param simple_html_dom_node $node |
|
1552 | + * @param boolean $is_child |
|
1553 | + */ |
|
1541 | 1554 | protected function link_nodes(&$node, $is_child) |
1542 | 1555 | { |
1543 | 1556 | $node->parent = $this->parent; |
@@ -1549,6 +1562,10 @@ discard block |
||
1549 | 1562 | } |
1550 | 1563 | |
1551 | 1564 | // as a text node |
1565 | + |
|
1566 | + /** |
|
1567 | + * @param string $tag |
|
1568 | + */ |
|
1552 | 1569 | protected function as_text_node($tag) |
1553 | 1570 | { |
1554 | 1571 | $node = new simple_html_dom_node($this); |
@@ -1559,12 +1576,18 @@ discard block |
||
1559 | 1576 | return true; |
1560 | 1577 | } |
1561 | 1578 | |
1579 | + /** |
|
1580 | + * @param string $chars |
|
1581 | + */ |
|
1562 | 1582 | protected function skip($chars) |
1563 | 1583 | { |
1564 | 1584 | $this->pos += strspn($this->doc, $chars, $this->pos); |
1565 | 1585 | $this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next |
1566 | 1586 | } |
1567 | 1587 | |
1588 | + /** |
|
1589 | + * @param string $chars |
|
1590 | + */ |
|
1568 | 1591 | protected function copy_skip($chars) |
1569 | 1592 | { |
1570 | 1593 | $pos = $this->pos; |
@@ -1575,6 +1598,9 @@ discard block |
||
1575 | 1598 | return substr($this->doc, $pos, $len); |
1576 | 1599 | } |
1577 | 1600 | |
1601 | + /** |
|
1602 | + * @param string $chars |
|
1603 | + */ |
|
1578 | 1604 | protected function copy_until($chars) |
1579 | 1605 | { |
1580 | 1606 | $pos = $this->pos; |
@@ -1584,6 +1610,9 @@ discard block |
||
1584 | 1610 | return substr($this->doc, $pos, $len); |
1585 | 1611 | } |
1586 | 1612 | |
1613 | + /** |
|
1614 | + * @param string $char |
|
1615 | + */ |
|
1587 | 1616 | protected function copy_until_char($char) |
1588 | 1617 | { |
1589 | 1618 | if ($this->char===null) return ''; |
@@ -1602,6 +1631,9 @@ discard block |
||
1602 | 1631 | return substr($this->doc, $pos_old, $pos-$pos_old); |
1603 | 1632 | } |
1604 | 1633 | |
1634 | + /** |
|
1635 | + * @param string $char |
|
1636 | + */ |
|
1605 | 1637 | protected function copy_until_char_escape($char) |
1606 | 1638 | { |
1607 | 1639 | if ($this->char===null) return ''; |
@@ -1633,6 +1665,10 @@ discard block |
||
1633 | 1665 | |
1634 | 1666 | // remove noise from html content |
1635 | 1667 | // save the noise in the $this->noise array. |
1668 | + |
|
1669 | + /** |
|
1670 | + * @param string $pattern |
|
1671 | + */ |
|
1636 | 1672 | protected function remove_noise($pattern, $remove_tag=false) |
1637 | 1673 | { |
1638 | 1674 | global $debug_object; |
@@ -1658,6 +1694,10 @@ discard block |
||
1658 | 1694 | } |
1659 | 1695 | |
1660 | 1696 | // restore noise to html content |
1697 | + |
|
1698 | + /** |
|
1699 | + * @param string|null $text |
|
1700 | + */ |
|
1661 | 1701 | function restore_noise($text) |
1662 | 1702 | { |
1663 | 1703 | global $debug_object; |
@@ -10,6 +10,9 @@ discard block |
||
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 | $fp = fopen($file, 'w+'); |
15 | 18 | $ch = curl_init(); |
@@ -24,6 +27,9 @@ discard block |
||
24 | 27 | fclose($fp); |
25 | 28 | } |
26 | 29 | |
30 | + /** |
|
31 | + * @param string $in_file |
|
32 | + */ |
|
27 | 33 | public static function gunzip($in_file,$out_file_name = '') { |
28 | 34 | //echo $in_file.' -> '.$out_file_name."\n"; |
29 | 35 | $buffer_size = 4096; // read 4kb at a time |
@@ -45,6 +51,9 @@ discard block |
||
45 | 51 | } |
46 | 52 | } |
47 | 53 | |
54 | + /** |
|
55 | + * @param string $in_file |
|
56 | + */ |
|
48 | 57 | public static function unzip($in_file) { |
49 | 58 | if ($in_file != '' && file_exists($in_file)) { |
50 | 59 | $path = pathinfo(realpath($in_file), PATHINFO_DIRNAME); |
@@ -66,6 +75,9 @@ discard block |
||
66 | 75 | } |
67 | 76 | } |
68 | 77 | |
78 | + /** |
|
79 | + * @param string $database_file |
|
80 | + */ |
|
69 | 81 | public static function retrieve_route_sqlite_to_dest($database_file) { |
70 | 82 | global $globalDebug, $globalTransaction; |
71 | 83 | //$query = 'TRUNCATE TABLE routes'; |
@@ -108,6 +120,10 @@ discard block |
||
108 | 120 | } |
109 | 121 | return ''; |
110 | 122 | } |
123 | + |
|
124 | + /** |
|
125 | + * @param string $database_file |
|
126 | + */ |
|
111 | 127 | public static function retrieve_route_oneworld($database_file) { |
112 | 128 | global $globalDebug, $globalTransaction; |
113 | 129 | //$query = 'TRUNCATE TABLE routes'; |
@@ -149,6 +165,9 @@ discard block |
||
149 | 165 | return ''; |
150 | 166 | } |
151 | 167 | |
168 | + /** |
|
169 | + * @param string $database_file |
|
170 | + */ |
|
152 | 171 | public static function retrieve_route_skyteam($database_file) { |
153 | 172 | global $globalDebug, $globalTransaction; |
154 | 173 | //$query = 'TRUNCATE TABLE routes'; |
@@ -191,6 +210,10 @@ discard block |
||
191 | 210 | } |
192 | 211 | return ''; |
193 | 212 | } |
213 | + |
|
214 | + /** |
|
215 | + * @param string $database_file |
|
216 | + */ |
|
194 | 217 | public static function retrieve_modes_sqlite_to_dest($database_file) { |
195 | 218 | global $globalTransaction; |
196 | 219 | //$query = 'TRUNCATE TABLE aircraft_modes'; |
@@ -257,6 +280,9 @@ discard block |
||
257 | 280 | return ''; |
258 | 281 | } |
259 | 282 | |
283 | + /** |
|
284 | + * @param string $database_file |
|
285 | + */ |
|
260 | 286 | public static function retrieve_modes_flarmnet($database_file) { |
261 | 287 | global $globalTransaction; |
262 | 288 | $Common = new Common(); |
@@ -327,6 +353,9 @@ discard block |
||
327 | 353 | return ''; |
328 | 354 | } |
329 | 355 | |
356 | + /** |
|
357 | + * @param string $database_file |
|
358 | + */ |
|
330 | 359 | public static function retrieve_modes_ogn($database_file) { |
331 | 360 | global $globalTransaction; |
332 | 361 | //$query = 'TRUNCATE TABLE aircraft_modes'; |
@@ -395,6 +424,9 @@ discard block |
||
395 | 424 | return ''; |
396 | 425 | } |
397 | 426 | |
427 | + /** |
|
428 | + * @param string $database_file |
|
429 | + */ |
|
398 | 430 | public static function retrieve_owner($database_file,$country = 'F') { |
399 | 431 | global $globalTransaction, $globalMasterSource; |
400 | 432 | //$query = 'TRUNCATE TABLE aircraft_modes'; |
@@ -1235,6 +1267,10 @@ discard block |
||
1235 | 1267 | return ''; |
1236 | 1268 | } |
1237 | 1269 | |
1270 | + /** |
|
1271 | + * @param string $filename |
|
1272 | + * @param string $tletype |
|
1273 | + */ |
|
1238 | 1274 | public static function tle($filename,$tletype) { |
1239 | 1275 | require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
1240 | 1276 | global $tmp_dir, $globalTransaction; |
@@ -1367,6 +1403,9 @@ discard block |
||
1367 | 1403 | |
1368 | 1404 | } |
1369 | 1405 | */ |
1406 | + /** |
|
1407 | + * @param string $filename |
|
1408 | + */ |
|
1370 | 1409 | public static function waypoints($filename) { |
1371 | 1410 | //require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
1372 | 1411 | global $tmp_dir, $globalTransaction; |
@@ -1414,6 +1453,9 @@ discard block |
||
1414 | 1453 | return ''; |
1415 | 1454 | } |
1416 | 1455 | |
1456 | + /** |
|
1457 | + * @param string $filename |
|
1458 | + */ |
|
1417 | 1459 | public static function ivao_airlines($filename) { |
1418 | 1460 | //require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
1419 | 1461 | global $tmp_dir, $globalTransaction; |
@@ -17,6 +17,10 @@ discard block |
||
17 | 17 | $this->db = $Connection->db(); |
18 | 18 | } |
19 | 19 | |
20 | + /** |
|
21 | + * @param string $type |
|
22 | + * @param string $stats_date |
|
23 | + */ |
|
20 | 24 | public function addLastStatsUpdate($type,$stats_date) { |
21 | 25 | $query = "DELETE FROM config WHERE name = :type; |
22 | 26 | INSERT INTO config (name,value) VALUES (:type,:stats_date);"; |
@@ -827,6 +831,11 @@ discard block |
||
827 | 831 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
828 | 832 | return $all; |
829 | 833 | } |
834 | + |
|
835 | + /** |
|
836 | + * @param string $type |
|
837 | + * @param string $year |
|
838 | + */ |
|
830 | 839 | public function getSumStats($type,$year,$stats_airline = '',$filter_name = '',$month = '') { |
831 | 840 | if ($filter_name == '') $filter_name = $this->filter_name; |
832 | 841 | global $globalArchiveMonths, $globalDBdriver; |
@@ -943,6 +952,10 @@ discard block |
||
943 | 952 | return $all[0]['total']; |
944 | 953 | } |
945 | 954 | |
955 | + /** |
|
956 | + * @param string $type |
|
957 | + * @param string $stats_date |
|
958 | + */ |
|
946 | 959 | public function addStat($type,$cnt,$stats_date,$stats_airline = '',$filter_name = '') { |
947 | 960 | global $globalDBdriver; |
948 | 961 | if ($filter_name == '') $filter_name = $this->filter_name; |
@@ -996,6 +1009,9 @@ discard block |
||
996 | 1009 | } |
997 | 1010 | */ |
998 | 1011 | |
1012 | + /** |
|
1013 | + * @param string $stats_type |
|
1014 | + */ |
|
999 | 1015 | public function getStatsSource($stats_type,$year = '',$month = '',$day = '') { |
1000 | 1016 | global $globalDBdriver; |
1001 | 1017 | $query = "SELECT * FROM stats_source WHERE stats_type = :stats_type"; |
@@ -1039,6 +1055,9 @@ discard block |
||
1039 | 1055 | return $all; |
1040 | 1056 | } |
1041 | 1057 | |
1058 | + /** |
|
1059 | + * @param string $stats_type |
|
1060 | + */ |
|
1042 | 1061 | public function addStatSource($data,$source_name,$stats_type,$date) { |
1043 | 1062 | global $globalDBdriver; |
1044 | 1063 | if ($globalDBdriver == 'mysql') { |
@@ -1054,6 +1073,10 @@ discard block |
||
1054 | 1073 | return "error : ".$e->getMessage(); |
1055 | 1074 | } |
1056 | 1075 | } |
1076 | + |
|
1077 | + /** |
|
1078 | + * @param string $type |
|
1079 | + */ |
|
1057 | 1080 | public function addStatFlight($type,$date_name,$cnt,$stats_airline = '',$filter_name = '') { |
1058 | 1081 | $query = "INSERT INTO stats_flight (stats_type,flight_date,cnt,stats_airline,filter_name) VALUES (:type,:flight_date,:cnt,:stats_airline,:filter_name)"; |
1059 | 1082 | $query_values = array(':type' => $type,':flight_date' => $date_name,':cnt' => $cnt, ':stats_airline' => $stats_airline,':filter_name' => $filter_name); |
@@ -1320,6 +1343,10 @@ discard block |
||
1320 | 1343 | return "error : ".$e->getMessage(); |
1321 | 1344 | } |
1322 | 1345 | } |
1346 | + |
|
1347 | + /** |
|
1348 | + * @param string $type |
|
1349 | + */ |
|
1323 | 1350 | public function deleteStatFlight($type) { |
1324 | 1351 | $query = "DELETE FROM stats_flight WHERE stats_type = :type"; |
1325 | 1352 | $query_values = array(':type' => $type); |
@@ -1330,6 +1357,10 @@ discard block |
||
1330 | 1357 | return "error : ".$e->getMessage(); |
1331 | 1358 | } |
1332 | 1359 | } |
1360 | + |
|
1361 | + /** |
|
1362 | + * @param string $type |
|
1363 | + */ |
|
1333 | 1364 | public function deleteStatAirport($type) { |
1334 | 1365 | $query = "DELETE FROM stats_airport WHERE stats_type = :type"; |
1335 | 1366 | $query_values = array(':type' => $type); |