@@ -3,6 +3,10 @@ |
||
3 | 3 | require_once(dirname(__FILE__).'/../require/class.Connection.php'); |
4 | 4 | |
5 | 5 | class create_db { |
6 | + |
|
7 | + /** |
|
8 | + * @param string $filename |
|
9 | + */ |
|
6 | 10 | public static function import_file($filename) { |
7 | 11 | $filename = filter_var($filename,FILTER_SANITIZE_STRING); |
8 | 12 | $Connection = new Connection(); |
@@ -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(); |
@@ -23,6 +26,9 @@ discard block |
||
23 | 26 | curl_close($ch); |
24 | 27 | } |
25 | 28 | |
29 | + /** |
|
30 | + * @param string $in_file |
|
31 | + */ |
|
26 | 32 | public static function gunzip($in_file,$out_file_name = '') { |
27 | 33 | //echo $in_file.' -> '.$out_file_name."\n"; |
28 | 34 | $buffer_size = 4096; // read 4kb at a time |
@@ -40,6 +46,9 @@ discard block |
||
40 | 46 | } |
41 | 47 | } |
42 | 48 | |
49 | + /** |
|
50 | + * @param string $in_file |
|
51 | + */ |
|
43 | 52 | public static function unzip($in_file) { |
44 | 53 | if ($in_file != '' && file_exists($in_file)) { |
45 | 54 | $path = pathinfo(realpath($in_file), PATHINFO_DIRNAME); |
@@ -61,6 +70,9 @@ discard block |
||
61 | 70 | } |
62 | 71 | } |
63 | 72 | |
73 | + /** |
|
74 | + * @param string $database_file |
|
75 | + */ |
|
64 | 76 | public static function retrieve_route_sqlite_to_dest($database_file) { |
65 | 77 | global $globalDebug, $globalTransaction; |
66 | 78 | //$query = 'TRUNCATE TABLE routes'; |
@@ -103,6 +115,10 @@ discard block |
||
103 | 115 | } |
104 | 116 | return ''; |
105 | 117 | } |
118 | + |
|
119 | + /** |
|
120 | + * @param string $database_file |
|
121 | + */ |
|
106 | 122 | public static function retrieve_modes_sqlite_to_dest($database_file) { |
107 | 123 | global $globalTransaction; |
108 | 124 | //$query = 'TRUNCATE TABLE aircraft_modes'; |
@@ -168,6 +184,9 @@ discard block |
||
168 | 184 | return ''; |
169 | 185 | } |
170 | 186 | |
187 | + /** |
|
188 | + * @param string $database_file |
|
189 | + */ |
|
171 | 190 | public static function retrieve_modes_flarmnet($database_file) { |
172 | 191 | global $globalTransaction; |
173 | 192 | $Common = new Common(); |
@@ -237,6 +256,9 @@ discard block |
||
237 | 256 | return ''; |
238 | 257 | } |
239 | 258 | |
259 | + /** |
|
260 | + * @param string $database_file |
|
261 | + */ |
|
240 | 262 | public static function retrieve_modes_ogn($database_file) { |
241 | 263 | global $globalTransaction; |
242 | 264 | //$query = 'TRUNCATE TABLE aircraft_modes'; |
@@ -305,6 +327,9 @@ discard block |
||
305 | 327 | return ''; |
306 | 328 | } |
307 | 329 | |
330 | + /** |
|
331 | + * @param string $database_file |
|
332 | + */ |
|
308 | 333 | public static function retrieve_owner($database_file,$country = 'F') { |
309 | 334 | global $globalTransaction; |
310 | 335 | //$query = 'TRUNCATE TABLE aircraft_modes'; |
@@ -937,6 +962,9 @@ discard block |
||
937 | 962 | |
938 | 963 | } |
939 | 964 | */ |
965 | + /** |
|
966 | + * @param string $filename |
|
967 | + */ |
|
940 | 968 | public static function waypoints($filename) { |
941 | 969 | //require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
942 | 970 | global $tmp_dir, $globalTransaction; |
@@ -993,6 +1021,9 @@ discard block |
||
993 | 1021 | return ''; |
994 | 1022 | } |
995 | 1023 | |
1024 | + /** |
|
1025 | + * @param string $filename |
|
1026 | + */ |
|
996 | 1027 | public static function ivao_airlines($filename) { |
997 | 1028 | //require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
998 | 1029 | global $tmp_dir, $globalTransaction; |
@@ -68,6 +68,9 @@ discard block |
||
68 | 68 | // ----------------------------------------------------------------------------- |
69 | 69 | // get html dom from file |
70 | 70 | // $maxlen is defined in the code as PHP_STREAM_COPY_ALL which is defined as -1. |
71 | +/** |
|
72 | + * @param string $url |
|
73 | + */ |
|
71 | 74 | function file_get_html($url, $use_include_path = false, $context=null, $offset = -1, $maxLen=-1, $lowercase = true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT) |
72 | 75 | { |
73 | 76 | // We DO force the tags to be terminated. |
@@ -125,6 +128,9 @@ discard block |
||
125 | 128 | public $tag_start = 0; |
126 | 129 | private $dom = null; |
127 | 130 | |
131 | + /** |
|
132 | + * @param simple_html_dom $dom |
|
133 | + */ |
|
128 | 134 | function __construct($dom) |
129 | 135 | { |
130 | 136 | $this->dom = $dom; |
@@ -1501,6 +1507,11 @@ discard block |
||
1501 | 1507 | } |
1502 | 1508 | |
1503 | 1509 | // parse attributes |
1510 | + |
|
1511 | + /** |
|
1512 | + * @param simple_html_dom_node $node |
|
1513 | + * @param string[] $space |
|
1514 | + */ |
|
1504 | 1515 | protected function parse_attr($node, $name, &$space) |
1505 | 1516 | { |
1506 | 1517 | // Per sourceforge: http://sourceforge.net/tracker/?func=detail&aid=3061408&group_id=218559&atid=1044037 |
@@ -1538,6 +1549,11 @@ discard block |
||
1538 | 1549 | } |
1539 | 1550 | |
1540 | 1551 | // link node's parent |
1552 | + |
|
1553 | + /** |
|
1554 | + * @param simple_html_dom_node $node |
|
1555 | + * @param boolean $is_child |
|
1556 | + */ |
|
1541 | 1557 | protected function link_nodes(&$node, $is_child) |
1542 | 1558 | { |
1543 | 1559 | $node->parent = $this->parent; |
@@ -1549,6 +1565,10 @@ discard block |
||
1549 | 1565 | } |
1550 | 1566 | |
1551 | 1567 | // as a text node |
1568 | + |
|
1569 | + /** |
|
1570 | + * @param string $tag |
|
1571 | + */ |
|
1552 | 1572 | protected function as_text_node($tag) |
1553 | 1573 | { |
1554 | 1574 | $node = new simple_html_dom_node($this); |
@@ -1559,12 +1579,18 @@ discard block |
||
1559 | 1579 | return true; |
1560 | 1580 | } |
1561 | 1581 | |
1582 | + /** |
|
1583 | + * @param string $chars |
|
1584 | + */ |
|
1562 | 1585 | protected function skip($chars) |
1563 | 1586 | { |
1564 | 1587 | $this->pos += strspn($this->doc, $chars, $this->pos); |
1565 | 1588 | $this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next |
1566 | 1589 | } |
1567 | 1590 | |
1591 | + /** |
|
1592 | + * @param string $chars |
|
1593 | + */ |
|
1568 | 1594 | protected function copy_skip($chars) |
1569 | 1595 | { |
1570 | 1596 | $pos = $this->pos; |
@@ -1575,6 +1601,9 @@ discard block |
||
1575 | 1601 | return substr($this->doc, $pos, $len); |
1576 | 1602 | } |
1577 | 1603 | |
1604 | + /** |
|
1605 | + * @param string $chars |
|
1606 | + */ |
|
1578 | 1607 | protected function copy_until($chars) |
1579 | 1608 | { |
1580 | 1609 | $pos = $this->pos; |
@@ -1584,6 +1613,9 @@ discard block |
||
1584 | 1613 | return substr($this->doc, $pos, $len); |
1585 | 1614 | } |
1586 | 1615 | |
1616 | + /** |
|
1617 | + * @param string $char |
|
1618 | + */ |
|
1587 | 1619 | protected function copy_until_char($char) |
1588 | 1620 | { |
1589 | 1621 | if ($this->char===null) return ''; |
@@ -1602,6 +1634,9 @@ discard block |
||
1602 | 1634 | return substr($this->doc, $pos_old, $pos-$pos_old); |
1603 | 1635 | } |
1604 | 1636 | |
1637 | + /** |
|
1638 | + * @param string $char |
|
1639 | + */ |
|
1605 | 1640 | protected function copy_until_char_escape($char) |
1606 | 1641 | { |
1607 | 1642 | if ($this->char===null) return ''; |
@@ -1633,6 +1668,10 @@ discard block |
||
1633 | 1668 | |
1634 | 1669 | // remove noise from html content |
1635 | 1670 | // save the noise in the $this->noise array. |
1671 | + |
|
1672 | + /** |
|
1673 | + * @param string $pattern |
|
1674 | + */ |
|
1636 | 1675 | protected function remove_noise($pattern, $remove_tag=false) |
1637 | 1676 | { |
1638 | 1677 | global $debug_object; |
@@ -1658,6 +1697,10 @@ discard block |
||
1658 | 1697 | } |
1659 | 1698 | |
1660 | 1699 | // restore noise to html content |
1700 | + |
|
1701 | + /** |
|
1702 | + * @param string|null $text |
|
1703 | + */ |
|
1661 | 1704 | function restore_noise($text) |
1662 | 1705 | { |
1663 | 1706 | global $debug_object; |
@@ -13,6 +13,9 @@ discard block |
||
13 | 13 | function sparql_connect( $endpoint ) { return new sparql_connection( $endpoint ); } |
14 | 14 | |
15 | 15 | function sparql_ns( $short, $long, $db = null ) { return _sparql_a_connection( $db )->ns( $short, $long ); } |
16 | +/** |
|
17 | + * @param string $sparql |
|
18 | + */ |
|
16 | 19 | function sparql_query( $sparql, $db = null ) { return _sparql_a_connection( $db )->query( $sparql ); } |
17 | 20 | function sparql_errno( $db = null ) { return _sparql_a_connection( $db )->errno(); } |
18 | 21 | function sparql_error( $db = null ) { return _sparql_a_connection( $db )->error(); } |
@@ -84,6 +87,9 @@ discard block |
||
84 | 87 | $this->params = $params; |
85 | 88 | } |
86 | 89 | |
90 | + /** |
|
91 | + * @param integer $timeout |
|
92 | + */ |
|
87 | 93 | function query( $query, $timeout=null ) |
88 | 94 | { |
89 | 95 | $prefixes = ""; |
@@ -324,6 +330,10 @@ discard block |
||
324 | 330 | var $fields; |
325 | 331 | var $db; |
326 | 332 | var $i = 0; |
333 | + |
|
334 | + /** |
|
335 | + * @param sparql_connection $db |
|
336 | + */ |
|
327 | 337 | function __construct( $db, $rows, $fields ) |
328 | 338 | { |
329 | 339 | $this->rows = $rows; |
@@ -809,8 +809,6 @@ |
||
809 | 809 | /** |
810 | 810 | * Get Message title from label from DB |
811 | 811 | * |
812 | - * @param String $ident |
|
813 | - * @return Array Return ACARS data in array |
|
814 | 812 | */ |
815 | 813 | public function getTitlefromLabel($label) { |
816 | 814 | $Connection = new Connection($this->db); |
@@ -1,5 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | class aprs { |
3 | + |
|
4 | + /** |
|
5 | + * @param integer $n |
|
6 | + * @param integer $s |
|
7 | + */ |
|
3 | 8 | private function urshift($n, $s) { |
4 | 9 | return ($n >= 0) ? ($n >> $s) : |
5 | 10 | (($n & 0x7fffffff) >> $s) | |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * Check is distance realistic |
161 | 161 | * @param int $timeDifference the time between the reception of both messages |
162 | 162 | * @param float $distance distance covered |
163 | - * @return whether distance is realistic |
|
163 | + * @return boolean distance is realistic |
|
164 | 164 | */ |
165 | 165 | public function withinThreshold ($timeDifference, $distance) { |
166 | 166 | $x = abs($timeDifference); |
@@ -183,6 +183,9 @@ discard block |
||
183 | 183 | } |
184 | 184 | |
185 | 185 | |
186 | + /** |
|
187 | + * @param string $latlong |
|
188 | + */ |
|
186 | 189 | public function convertDec($dms,$latlong) { |
187 | 190 | if ($latlong == 'latitude') { |
188 | 191 | $deg = substr($dms, 0, 2); |
@@ -274,7 +277,7 @@ discard block |
||
274 | 277 | /** |
275 | 278 | * Returns list of available locales |
276 | 279 | * |
277 | - * @return array |
|
280 | + * @return string[] |
|
278 | 281 | */ |
279 | 282 | public function listLocaleDir() |
280 | 283 | { |
@@ -6,6 +6,9 @@ discard block |
||
6 | 6 | public $dbs = array(); |
7 | 7 | public $latest_schema = 23; |
8 | 8 | |
9 | + /** |
|
10 | + * @param string $dbname |
|
11 | + */ |
|
9 | 12 | public function __construct($dbc = null,$dbname = null) { |
10 | 13 | global $globalDBdriver; |
11 | 14 | if ($dbc === null) { |
@@ -102,6 +105,9 @@ discard block |
||
102 | 105 | return true; |
103 | 106 | } |
104 | 107 | |
108 | + /** |
|
109 | + * @param string $table |
|
110 | + */ |
|
105 | 111 | public function tableExists($table) |
106 | 112 | { |
107 | 113 | global $globalDBdriver, $globalDBname; |
@@ -327,6 +327,9 @@ |
||
327 | 327 | } |
328 | 328 | |
329 | 329 | |
330 | + /** |
|
331 | + * @param string $aircraft_icao |
|
332 | + */ |
|
330 | 333 | public function fromIvaoMtl($aircraft_icao,$airline_icao) { |
331 | 334 | $Common = new Common(); |
332 | 335 | //echo "\n".'SEARCH IMAGE : http://mtlcatalog.ivao.aero/images/aircraft/'.$aircraft_icao.$airline_icao.'.jpg'; |