@@ -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, $globalDBdriver; |
@@ -923,10 +923,6 @@ discard block |
||
923 | 923 | * |
924 | 924 | * @param String $fammarine_id the ID from flightaware |
925 | 925 | * @param String $ident the flight ident |
926 | - * @param String $aircraft_icao the aircraft type |
|
927 | - * @param String $departure_airport_icao the departure airport |
|
928 | - * @param String $arrival_airport_icao the arrival airport |
|
929 | - * @return String success or false |
|
930 | 926 | * |
931 | 927 | */ |
932 | 928 | public function addLiveMarineData($fammarine_id = '', $ident = '', $latitude = '', $longitude = '', $heading = '', $groundspeed = '', $date = '', $putinarchive = false, $mmsi = '',$type = '',$typeid = '',$imo = '', $callsign = '',$arrival_code = '',$arrival_date = '',$status = '',$statusid = '',$noarchive = false,$format_source = '', $source_name = '', $over_country = '',$captain_id = '',$captain_name = '',$race_id = '', $race_name = '', $distance = '', $race_rank = '', $race_time = '') |
@@ -53,6 +53,11 @@ discard block |
||
53 | 53 | $this->openedFiles = []; |
54 | 54 | } |
55 | 55 | |
56 | + /** |
|
57 | + * @param string $fileName |
|
58 | + * @param double $row |
|
59 | + * @param double $column |
|
60 | + */ |
|
56 | 61 | private function getElevationAtPosition($fileName, $row, $column) { |
57 | 62 | if (!array_key_exists($fileName, $this->openedFiles)) { |
58 | 63 | if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) { |
@@ -153,6 +158,9 @@ discard block |
||
153 | 158 | else return $zN; |
154 | 159 | } |
155 | 160 | |
161 | + /** |
|
162 | + * @param integer $numPrefix |
|
163 | + */ |
|
156 | 164 | private function getDeg($deg, $numPrefix) { |
157 | 165 | $deg = abs($deg); |
158 | 166 | $d = floor($deg); // round degrees |
@@ -167,6 +175,9 @@ discard block |
||
167 | 175 | return $d; |
168 | 176 | } |
169 | 177 | |
178 | + /** |
|
179 | + * @param double $deg |
|
180 | + */ |
|
170 | 181 | private function getSec($deg) { |
171 | 182 | $deg = abs($deg); |
172 | 183 | $sec = round($deg * 3600, 4); |
@@ -6,6 +6,9 @@ discard block |
||
6 | 6 | public $dbs = array(); |
7 | 7 | public $latest_schema = 55; |
8 | 8 | |
9 | + /** |
|
10 | + * @param string $dbname |
|
11 | + */ |
|
9 | 12 | public function __construct($dbc = null,$dbname = null,$user = null,$pass = null) { |
10 | 13 | global $globalNoDB; |
11 | 14 | if (isset($globalNoDB) && $globalNoDB === TRUE) { |
@@ -142,6 +145,9 @@ discard block |
||
142 | 145 | return true; |
143 | 146 | } |
144 | 147 | |
148 | + /** |
|
149 | + * @param string $table |
|
150 | + */ |
|
145 | 151 | public function tableExists($table) |
146 | 152 | { |
147 | 153 | global $globalDBdriver, $globalDBname; |
@@ -192,6 +198,11 @@ discard block |
||
192 | 198 | /* |
193 | 199 | * Check if index exist |
194 | 200 | */ |
201 | + |
|
202 | + /** |
|
203 | + * @param string $table |
|
204 | + * @param string $index |
|
205 | + */ |
|
195 | 206 | public function indexExists($table,$index) |
196 | 207 | { |
197 | 208 | global $globalDBdriver, $globalDBname; |
@@ -234,6 +245,10 @@ discard block |
||
234 | 245 | return $columns; |
235 | 246 | } |
236 | 247 | |
248 | + /** |
|
249 | + * @param string $table |
|
250 | + * @param string $column |
|
251 | + */ |
|
237 | 252 | public function getColumnType($table,$column) { |
238 | 253 | $select = $this->db->query('SELECT '.$column.' FROM '.$table); |
239 | 254 | $tomet = $select->getColumnMeta(0); |
@@ -244,6 +259,11 @@ discard block |
||
244 | 259 | * Check if a column name exist in a table |
245 | 260 | * @return Boolean column exist or not |
246 | 261 | */ |
262 | + |
|
263 | + /** |
|
264 | + * @param string $table |
|
265 | + * @param string $name |
|
266 | + */ |
|
247 | 267 | public function checkColumnName($table,$name) |
248 | 268 | { |
249 | 269 | global $globalDBdriver, $globalDBname; |
@@ -126,6 +126,9 @@ discard block |
||
126 | 126 | fclose($fp); |
127 | 127 | } |
128 | 128 | |
129 | + /** |
|
130 | + * @param string $in_file |
|
131 | + */ |
|
129 | 132 | public static function gunzip($in_file,$out_file_name = '') { |
130 | 133 | //echo $in_file.' -> '.$out_file_name."\n"; |
131 | 134 | $buffer_size = 4096; // read 4kb at a time |
@@ -287,7 +290,7 @@ discard block |
||
287 | 290 | * Check is distance realistic |
288 | 291 | * @param int $timeDifference the time between the reception of both messages |
289 | 292 | * @param float $distance distance covered |
290 | - * @return whether distance is realistic |
|
293 | + * @return boolean distance is realistic |
|
291 | 294 | */ |
292 | 295 | public function withinThreshold ($timeDifference, $distance) { |
293 | 296 | $x = abs($timeDifference); |
@@ -311,6 +314,9 @@ discard block |
||
311 | 314 | } |
312 | 315 | |
313 | 316 | |
317 | + /** |
|
318 | + * @param string $latlong |
|
319 | + */ |
|
314 | 320 | public function convertDec($dms,$latlong) { |
315 | 321 | if ($latlong == 'latitude') { |
316 | 322 | $deg = substr($dms, 0, 2); |
@@ -345,6 +351,9 @@ discard block |
||
345 | 351 | return array('latitude' => round($latitude,5),'longitude' => round($longitude,5)); |
346 | 352 | } |
347 | 353 | |
354 | + /** |
|
355 | + * @param string $latlong |
|
356 | + */ |
|
348 | 357 | public function convertDM($coord,$latlong) { |
349 | 358 | if ($latlong == 'latitude') { |
350 | 359 | if ($coord < 0) $NSEW = 'S'; |
@@ -482,7 +491,7 @@ discard block |
||
482 | 491 | /** |
483 | 492 | * Returns list of available locales |
484 | 493 | * |
485 | - * @return array |
|
494 | + * @return string[] |
|
486 | 495 | */ |
487 | 496 | public function listLocaleDir() |
488 | 497 | { |
@@ -179,6 +179,9 @@ |
||
179 | 179 | } |
180 | 180 | } |
181 | 181 | |
182 | + /** |
|
183 | + * @param string $type |
|
184 | + */ |
|
182 | 185 | public function deleteLocationByType($type) { |
183 | 186 | $query = "DELETE FROM source_location WHERE type = :type"; |
184 | 187 | $query_values = array(':type' => $type); |
@@ -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 | global $globalProxy, $globalForceIPv4; |
15 | 18 | $fp = fopen($file, 'w'); |
@@ -34,6 +37,9 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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'; |
@@ -1438,6 +1470,10 @@ discard block |
||
1438 | 1470 | return ''; |
1439 | 1471 | } |
1440 | 1472 | |
1473 | + /** |
|
1474 | + * @param string $filename |
|
1475 | + * @param string $tletype |
|
1476 | + */ |
|
1441 | 1477 | public static function tle($filename,$tletype) { |
1442 | 1478 | require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
1443 | 1479 | global $tmp_dir, $globalTransaction; |
@@ -1487,6 +1523,9 @@ discard block |
||
1487 | 1523 | return ''; |
1488 | 1524 | } |
1489 | 1525 | |
1526 | + /** |
|
1527 | + * @param string $filename |
|
1528 | + */ |
|
1490 | 1529 | public static function satellite_ucsdb($filename) { |
1491 | 1530 | global $tmp_dir, $globalTransaction; |
1492 | 1531 | |
@@ -1535,6 +1574,9 @@ discard block |
||
1535 | 1574 | return ''; |
1536 | 1575 | } |
1537 | 1576 | |
1577 | + /** |
|
1578 | + * @param string $filename |
|
1579 | + */ |
|
1538 | 1580 | public static function satellite_celestrak($filename) { |
1539 | 1581 | global $tmp_dir, $globalTransaction, $globalDebug; |
1540 | 1582 | $satcat_sources = array( |
@@ -1861,6 +1903,9 @@ discard block |
||
1861 | 1903 | |
1862 | 1904 | } |
1863 | 1905 | */ |
1906 | + /** |
|
1907 | + * @param string $filename |
|
1908 | + */ |
|
1864 | 1909 | public static function waypoints($filename) { |
1865 | 1910 | //require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
1866 | 1911 | global $tmp_dir, $globalTransaction; |
@@ -1938,6 +1983,9 @@ discard block |
||
1938 | 1983 | } |
1939 | 1984 | } |
1940 | 1985 | |
1986 | + /** |
|
1987 | + * @param string $filename |
|
1988 | + */ |
|
1941 | 1989 | public static function ivao_airlines($filename) { |
1942 | 1990 | //require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
1943 | 1991 | global $tmp_dir, $globalTransaction; |