@@ -2760,7 +2760,7 @@ discard block |
||
| 2760 | 2760 | * @since 1.0 |
| 2761 | 2761 | * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo |
| 2762 | 2762 | * @link http://www.georss.org/ GeoRSS |
| 2763 | - * @return string|null |
|
| 2763 | + * @return double|null |
|
| 2764 | 2764 | */ |
| 2765 | 2765 | public function get_latitude() |
| 2766 | 2766 | { |
@@ -2789,7 +2789,7 @@ discard block |
||
| 2789 | 2789 | * @since 1.0 |
| 2790 | 2790 | * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo |
| 2791 | 2791 | * @link http://www.georss.org/ GeoRSS |
| 2792 | - * @return string|null |
|
| 2792 | + * @return double|null |
|
| 2793 | 2793 | */ |
| 2794 | 2794 | public function get_longitude() |
| 2795 | 2795 | { |
@@ -2930,7 +2930,7 @@ discard block |
||
| 2930 | 2930 | * Uses `<image><width>` or defaults to 88.0 if no width is specified and |
| 2931 | 2931 | * the feed is an RSS 2.0 feed. |
| 2932 | 2932 | * |
| 2933 | - * @return int|float|null |
|
| 2933 | + * @return double|null |
|
| 2934 | 2934 | */ |
| 2935 | 2935 | public function get_image_width() |
| 2936 | 2936 | { |
@@ -2956,7 +2956,7 @@ discard block |
||
| 2956 | 2956 | * Uses `<image><height>` or defaults to 31.0 if no height is specified and |
| 2957 | 2957 | * the feed is an RSS 2.0 feed. |
| 2958 | 2958 | * |
| 2959 | - * @return int|float|null |
|
| 2959 | + * @return double|null |
|
| 2960 | 2960 | */ |
| 2961 | 2961 | public function get_image_height() |
| 2962 | 2962 | { |
@@ -3185,7 +3185,7 @@ discard block |
||
| 3185 | 3185 | * @access private |
| 3186 | 3186 | * @param SimplePie $a |
| 3187 | 3187 | * @param SimplePie $b |
| 3188 | - * @return boolean |
|
| 3188 | + * @return integer |
|
| 3189 | 3189 | */ |
| 3190 | 3190 | public static function sort_items($a, $b) |
| 3191 | 3191 | { |
@@ -4384,7 +4384,7 @@ discard block |
||
| 4384 | 4384 | /** |
| 4385 | 4385 | * Retrieve the last modified time for the cache |
| 4386 | 4386 | * |
| 4387 | - * @return int Timestamp |
|
| 4387 | + * @return false|string Timestamp |
|
| 4388 | 4388 | */ |
| 4389 | 4389 | public function mtime() |
| 4390 | 4390 | { |
@@ -4504,7 +4504,6 @@ discard block |
||
| 4504 | 4504 | * |
| 4505 | 4505 | * @param string $location Location string (from SimplePie::$cache_location) |
| 4506 | 4506 | * @param string $name Unique ID for the cache |
| 4507 | - * @param string $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data |
|
| 4508 | 4507 | */ |
| 4509 | 4508 | public function __construct($location, $name, $options = null) { |
| 4510 | 4509 | //$this->cache = \flow\simple\cache\Redis::getRedisClientInstance(); |
@@ -5461,7 +5460,7 @@ discard block |
||
| 5461 | 5460 | * Consume the next byte |
| 5462 | 5461 | * |
| 5463 | 5462 | * @access private |
| 5464 | - * @return mixed The next byte, or false, if there is no more data |
|
| 5463 | + * @return string|false The next byte, or false, if there is no more data |
|
| 5465 | 5464 | */ |
| 5466 | 5465 | public function consume() |
| 5467 | 5466 | { |
@@ -5481,7 +5480,7 @@ discard block |
||
| 5481 | 5480 | * |
| 5482 | 5481 | * @access private |
| 5483 | 5482 | * @param string $chars Characters to consume |
| 5484 | - * @return mixed A series of characters that match the range, or false |
|
| 5483 | + * @return string|false A series of characters that match the range, or false |
|
| 5485 | 5484 | */ |
| 5486 | 5485 | public function consume_range($chars) |
| 5487 | 5486 | { |
@@ -6571,7 +6570,7 @@ discard block |
||
| 6571 | 6570 | /** |
| 6572 | 6571 | * Get length |
| 6573 | 6572 | * |
| 6574 | - * @return float Length in bytes |
|
| 6573 | + * @return string|null Length in bytes |
|
| 6575 | 6574 | */ |
| 6576 | 6575 | public function get_length() |
| 6577 | 6576 | { |
@@ -8279,7 +8278,7 @@ discard block |
||
| 8279 | 8278 | * |
| 8280 | 8279 | * Returns false if $base is not absolute, otherwise an IRI. |
| 8281 | 8280 | * |
| 8282 | - * @param IRI|string $base (Absolute) Base IRI |
|
| 8281 | + * @param SimplePie_IRI $base (Absolute) Base IRI |
|
| 8283 | 8282 | * @param IRI|string $relative Relative IRI |
| 8284 | 8283 | * @return IRI|false |
| 8285 | 8284 | */ |
@@ -9068,7 +9067,7 @@ discard block |
||
| 9068 | 9067 | * Set the ipath. |
| 9069 | 9068 | * |
| 9070 | 9069 | * @param string $ipath |
| 9071 | - * @return bool |
|
| 9070 | + * @return null|boolean |
|
| 9072 | 9071 | */ |
| 9073 | 9072 | public function set_path($ipath, $clear_cache = false) |
| 9074 | 9073 | { |
@@ -9145,6 +9144,7 @@ discard block |
||
| 9145 | 9144 | /** |
| 9146 | 9145 | * Convert an IRI to a URI (or parts thereof) |
| 9147 | 9146 | * |
| 9147 | + * @param false|string $string |
|
| 9148 | 9148 | * @return string |
| 9149 | 9149 | */ |
| 9150 | 9150 | public function to_uri($string) |
@@ -10114,7 +10114,7 @@ discard block |
||
| 10114 | 10114 | * @since 1.0 |
| 10115 | 10115 | * |
| 10116 | 10116 | * @param string $date_format Supports any PHP date format from {@see http://php.net/strftime} (empty for the raw data) |
| 10117 | - * @return int|string|null |
|
| 10117 | + * @return string|null |
|
| 10118 | 10118 | */ |
| 10119 | 10119 | public function get_local_date($date_format = '%c') |
| 10120 | 10120 | { |
@@ -10137,7 +10137,7 @@ discard block |
||
| 10137 | 10137 | * |
| 10138 | 10138 | * @see get_date |
| 10139 | 10139 | * @param string $date_format Supports any PHP date format from {@see http://php.net/date} |
| 10140 | - * @return int|string|null |
|
| 10140 | + * @return null|string |
|
| 10141 | 10141 | */ |
| 10142 | 10142 | public function get_gmdate($date_format = 'j F Y, g:i a') |
| 10143 | 10143 | { |
@@ -10155,7 +10155,7 @@ discard block |
||
| 10155 | 10155 | * |
| 10156 | 10156 | * @see get_updated_date |
| 10157 | 10157 | * @param string $date_format Supports any PHP date format from {@see http://php.net/date} |
| 10158 | - * @return int|string|null |
|
| 10158 | + * @return null|string |
|
| 10159 | 10159 | */ |
| 10160 | 10160 | public function get_updated_gmdate($date_format = 'j F Y, g:i a') |
| 10161 | 10161 | { |
@@ -12159,7 +12159,7 @@ discard block |
||
| 12159 | 12159 | * @since 1.0 |
| 12160 | 12160 | * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo |
| 12161 | 12161 | * @link http://www.georss.org/ GeoRSS |
| 12162 | - * @return string|null |
|
| 12162 | + * @return double|null |
|
| 12163 | 12163 | */ |
| 12164 | 12164 | public function get_latitude() |
| 12165 | 12165 | { |
@@ -12187,7 +12187,7 @@ discard block |
||
| 12187 | 12187 | * @since 1.0 |
| 12188 | 12188 | * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo |
| 12189 | 12189 | * @link http://www.georss.org/ GeoRSS |
| 12190 | - * @return string|null |
|
| 12190 | + * @return double|null |
|
| 12191 | 12191 | */ |
| 12192 | 12192 | public function get_longitude() |
| 12193 | 12193 | { |
@@ -12403,6 +12403,9 @@ discard block |
||
| 12403 | 12403 | } |
| 12404 | 12404 | } |
| 12405 | 12405 | |
| 12406 | + /** |
|
| 12407 | + * @param string $name |
|
| 12408 | + */ |
|
| 12406 | 12409 | protected function search_elements_by_tag($name, &$done, $feeds) |
| 12407 | 12410 | { |
| 12408 | 12411 | if ($this->dom === null) |
@@ -12621,6 +12624,9 @@ discard block |
||
| 12621 | 12624 | */ |
| 12622 | 12625 | class SimplePie_Misc |
| 12623 | 12626 | { |
| 12627 | + /** |
|
| 12628 | + * @param integer $seconds |
|
| 12629 | + */ |
|
| 12624 | 12630 | public static function time_hms($seconds) |
| 12625 | 12631 | { |
| 12626 | 12632 | $time = ''; |
@@ -12923,6 +12929,11 @@ discard block |
||
| 12923 | 12929 | } |
| 12924 | 12930 | } |
| 12925 | 12931 | |
| 12932 | + /** |
|
| 12933 | + * @param string $data |
|
| 12934 | + * @param string $input |
|
| 12935 | + * @param string $output |
|
| 12936 | + */ |
|
| 12926 | 12937 | protected static function change_encoding_mbstring($data, $input, $output) |
| 12927 | 12938 | { |
| 12928 | 12939 | if ($input === 'windows-949') |
@@ -12961,6 +12972,11 @@ discard block |
||
| 12961 | 12972 | return false; |
| 12962 | 12973 | } |
| 12963 | 12974 | |
| 12975 | + /** |
|
| 12976 | + * @param string $data |
|
| 12977 | + * @param string $input |
|
| 12978 | + * @param string $output |
|
| 12979 | + */ |
|
| 12964 | 12980 | protected static function change_encoding_iconv($data, $input, $output) |
| 12965 | 12981 | { |
| 12966 | 12982 | return @iconv($input, $output, $data); |
@@ -14301,6 +14317,9 @@ discard block |
||
| 14301 | 14317 | } |
| 14302 | 14318 | } |
| 14303 | 14319 | |
| 14320 | + /** |
|
| 14321 | + * @return string |
|
| 14322 | + */ |
|
| 14304 | 14323 | public static function get_curl_version() |
| 14305 | 14324 | { |
| 14306 | 14325 | if (is_array($curl = curl_version())) |
@@ -14368,7 +14387,6 @@ discard block |
||
| 14368 | 14387 | /** |
| 14369 | 14388 | * Remove RFC822 comments |
| 14370 | 14389 | * |
| 14371 | - * @param string $data Data to strip comments from |
|
| 14372 | 14390 | * @return string Comment stripped string |
| 14373 | 14391 | */ |
| 14374 | 14392 | public static function uncomment_rfc822($string) |
@@ -14624,7 +14642,7 @@ discard block |
||
| 14624 | 14642 | * @todo Add support for EBCDIC |
| 14625 | 14643 | * @param string $data XML data |
| 14626 | 14644 | * @param SimplePie_Registry $registry Class registry |
| 14627 | - * @return array Possible encodings |
|
| 14645 | + * @return string[] Possible encodings |
|
| 14628 | 14646 | */ |
| 14629 | 14647 | public static function xml_encoding($data, $registry) |
| 14630 | 14648 | { |
@@ -14997,7 +15015,7 @@ discard block |
||
| 14997 | 15015 | * 0:0:0:0:0:FFFF:129.144.52.38 |
| 14998 | 15016 | * |
| 14999 | 15017 | * @param string $ip An IPv6 address |
| 15000 | - * @return array [0] contains the IPv6 represented part, and [1] the IPv4 represented part |
|
| 15018 | + * @return string[] [0] contains the IPv6 represented part, and [1] the IPv4 represented part |
|
| 15001 | 15019 | */ |
| 15002 | 15020 | private static function split_v6_v4($ip) |
| 15003 | 15021 | { |
@@ -15744,7 +15762,6 @@ discard block |
||
| 15744 | 15762 | * Remove RFC822 comments |
| 15745 | 15763 | * |
| 15746 | 15764 | * @access protected |
| 15747 | - * @param string $data Data to strip comments from |
|
| 15748 | 15765 | * @return string Comment stripped string |
| 15749 | 15766 | */ |
| 15750 | 15767 | public function remove_rfc2822_comments($string) |
@@ -16258,6 +16275,9 @@ discard block |
||
| 16258 | 16275 | return $this->data; |
| 16259 | 16276 | } |
| 16260 | 16277 | |
| 16278 | + /** |
|
| 16279 | + * @param string $tag |
|
| 16280 | + */ |
|
| 16261 | 16281 | public function tag_open($parser, $tag, $attributes) |
| 16262 | 16282 | { |
| 16263 | 16283 | list($this->namespace[], $this->element[]) = $this->split_ns($tag); |
@@ -16325,6 +16345,9 @@ discard block |
||
| 16325 | 16345 | } |
| 16326 | 16346 | } |
| 16327 | 16347 | |
| 16348 | + /** |
|
| 16349 | + * @param string $cdata |
|
| 16350 | + */ |
|
| 16328 | 16351 | public function cdata($parser, $cdata) |
| 16329 | 16352 | { |
| 16330 | 16353 | if ($this->current_xhtml_construct >= 0) |
@@ -16337,6 +16360,9 @@ discard block |
||
| 16337 | 16360 | } |
| 16338 | 16361 | } |
| 16339 | 16362 | |
| 16363 | + /** |
|
| 16364 | + * @param string $tag |
|
| 16365 | + */ |
|
| 16340 | 16366 | public function tag_close($parser, $tag) |
| 16341 | 16367 | { |
| 16342 | 16368 | if ($this->current_xhtml_construct >= 0) |
@@ -16422,6 +16448,9 @@ discard block |
||
| 16422 | 16448 | return isset($data['value']) ? $data['value'] : ''; |
| 16423 | 16449 | } |
| 16424 | 16450 | |
| 16451 | + /** |
|
| 16452 | + * @param string $url |
|
| 16453 | + */ |
|
| 16425 | 16454 | private function parse_microformats(&$data, $url) { |
| 16426 | 16455 | $feed_title = ''; |
| 16427 | 16456 | $feed_author = NULL; |
@@ -16953,6 +16982,8 @@ discard block |
||
| 16953 | 16982 | * |
| 16954 | 16983 | * For documentation on all the parameters, see the corresponding |
| 16955 | 16984 | * properties and their accessors |
| 16985 | + * @param string $relationship |
|
| 16986 | + * @param string $value |
|
| 16956 | 16987 | */ |
| 16957 | 16988 | public function __construct($relationship = null, $type = null, $value = null) |
| 16958 | 16989 | { |
@@ -17390,6 +17421,9 @@ discard block |
||
| 17390 | 17421 | return $data; |
| 17391 | 17422 | } |
| 17392 | 17423 | |
| 17424 | + /** |
|
| 17425 | + * @param string $html |
|
| 17426 | + */ |
|
| 17393 | 17427 | protected function preprocess($html, $type) |
| 17394 | 17428 | { |
| 17395 | 17429 | $ret = ''; |
@@ -17414,6 +17448,9 @@ discard block |
||
| 17414 | 17448 | return $ret; |
| 17415 | 17449 | } |
| 17416 | 17450 | |
| 17451 | + /** |
|
| 17452 | + * @param DOMDocument $document |
|
| 17453 | + */ |
|
| 17417 | 17454 | public function replace_urls($document, $tag, $attributes) |
| 17418 | 17455 | { |
| 17419 | 17456 | if (!is_array($attributes)) |
@@ -17466,6 +17503,10 @@ discard block |
||
| 17466 | 17503 | } |
| 17467 | 17504 | } |
| 17468 | 17505 | |
| 17506 | + /** |
|
| 17507 | + * @param DOMDocument $document |
|
| 17508 | + * @param DOMXPath $xpath |
|
| 17509 | + */ |
|
| 17469 | 17510 | protected function strip_tag($tag, $document, $xpath, $type) |
| 17470 | 17511 | { |
| 17471 | 17512 | $elements = $xpath->query('body//' . $tag); |
@@ -17550,6 +17591,9 @@ discard block |
||
| 17550 | 17591 | } |
| 17551 | 17592 | } |
| 17552 | 17593 | |
| 17594 | + /** |
|
| 17595 | + * @param DOMXPath $xpath |
|
| 17596 | + */ |
|
| 17553 | 17597 | protected function strip_attr($attrib, $xpath) |
| 17554 | 17598 | { |
| 17555 | 17599 | $elements = $xpath->query('//*[@' . $attrib . ']'); |
@@ -17560,6 +17604,9 @@ discard block |
||
| 17560 | 17604 | } |
| 17561 | 17605 | } |
| 17562 | 17606 | |
| 17607 | + /** |
|
| 17608 | + * @param DOMDocument $document |
|
| 17609 | + */ |
|
| 17563 | 17610 | protected function add_attr($tag, $valuePairs, $document) |
| 17564 | 17611 | { |
| 17565 | 17612 | $elements = $document->getElementsByTagName($tag); |
@@ -17605,6 +17652,10 @@ discard block |
||
| 17605 | 17652 | return md5(serialize($this->data)); |
| 17606 | 17653 | } |
| 17607 | 17654 | |
| 17655 | + /** |
|
| 17656 | + * @param string $namespace |
|
| 17657 | + * @param string $tag |
|
| 17658 | + */ |
|
| 17608 | 17659 | public function get_source_tags($namespace, $tag) |
| 17609 | 17660 | { |
| 17610 | 17661 | if (isset($this->data['child'][$namespace][$tag])) |
@@ -17617,6 +17668,9 @@ discard block |
||
| 17617 | 17668 | } |
| 17618 | 17669 | } |
| 17619 | 17670 | |
| 17671 | + /** |
|
| 17672 | + * @return string |
|
| 17673 | + */ |
|
| 17620 | 17674 | public function get_base($element = array()) |
| 17621 | 17675 | { |
| 17622 | 17676 | return $this->item->get_base($element); |
@@ -97,6 +97,10 @@ discard block |
||
| 97 | 97 | return strlen($headerLine); // Needed by curl |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | + /** |
|
| 101 | + * @param string $url |
|
| 102 | + * @param string $file |
|
| 103 | + */ |
|
| 100 | 104 | public static function download($url, $file, $referer = '') { |
| 101 | 105 | global $globalDebug, $globalProxy, $globalForceIPv4; |
| 102 | 106 | $fp = fopen($file, 'w'); |
@@ -121,6 +125,9 @@ discard block |
||
| 121 | 125 | fclose($fp); |
| 122 | 126 | } |
| 123 | 127 | |
| 128 | + /** |
|
| 129 | + * @param string $in_file |
|
| 130 | + */ |
|
| 124 | 131 | public static function gunzip($in_file,$out_file_name = '') { |
| 125 | 132 | //echo $in_file.' -> '.$out_file_name."\n"; |
| 126 | 133 | $buffer_size = 4096; // read 4kb at a time |
@@ -272,7 +279,7 @@ discard block |
||
| 272 | 279 | * Check is distance realistic |
| 273 | 280 | * @param int $timeDifference the time between the reception of both messages |
| 274 | 281 | * @param float $distance distance covered |
| 275 | - * @return whether distance is realistic |
|
| 282 | + * @return boolean distance is realistic |
|
| 276 | 283 | */ |
| 277 | 284 | public function withinThreshold ($timeDifference, $distance) { |
| 278 | 285 | $x = abs($timeDifference); |
@@ -295,6 +302,9 @@ discard block |
||
| 295 | 302 | } |
| 296 | 303 | |
| 297 | 304 | |
| 305 | + /** |
|
| 306 | + * @param string $latlong |
|
| 307 | + */ |
|
| 298 | 308 | public function convertDec($dms,$latlong) { |
| 299 | 309 | if ($latlong == 'latitude') { |
| 300 | 310 | $deg = substr($dms, 0, 2); |
@@ -306,6 +316,9 @@ discard block |
||
| 306 | 316 | return $deg+(($min*60)/3600); |
| 307 | 317 | } |
| 308 | 318 | |
| 319 | + /** |
|
| 320 | + * @param string $latlong |
|
| 321 | + */ |
|
| 309 | 322 | public function convertDM($coord,$latlong) { |
| 310 | 323 | if ($latlong == 'latitude') { |
| 311 | 324 | if ($coord < 0) $NSEW = 'S'; |
@@ -443,7 +456,7 @@ discard block |
||
| 443 | 456 | /** |
| 444 | 457 | * Returns list of available locales |
| 445 | 458 | * |
| 446 | - * @return array |
|
| 459 | + * @return string[] |
|
| 447 | 460 | */ |
| 448 | 461 | public function listLocaleDir() |
| 449 | 462 | { |
@@ -174,6 +174,10 @@ |
||
| 174 | 174 | '\|' => 'TNC Stream SW', |
| 175 | 175 | '\~' => 'TNC Stream SW'); |
| 176 | 176 | |
| 177 | + /** |
|
| 178 | + * @param integer $n |
|
| 179 | + * @param integer $s |
|
| 180 | + */ |
|
| 177 | 181 | private function urshift($n, $s) { |
| 178 | 182 | return ($n >= 0) ? ($n >> $s) : |
| 179 | 183 | (($n & 0x7fffffff) >> $s) | |
@@ -6,6 +6,9 @@ discard block |
||
| 6 | 6 | public $dbs = array(); |
| 7 | 7 | public $latest_schema = 50; |
| 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; |
@@ -190,12 +190,20 @@ |
||
| 190 | 190 | return 1; |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | + /** |
|
| 194 | + * @param double $lat |
|
| 195 | + * @param integer $isodd |
|
| 196 | + */ |
|
| 193 | 197 | private function cprN($lat,$isodd) { |
| 194 | 198 | $nl = $this->cprNL($lat) - $isodd; |
| 195 | 199 | if ($nl > 1) return $nl; |
| 196 | 200 | else return 1; |
| 197 | 201 | } |
| 198 | 202 | |
| 203 | + /** |
|
| 204 | + * @param string $msg |
|
| 205 | + * @param string $bin |
|
| 206 | + */ |
|
| 199 | 207 | private function parityCheck($msg, $bin) { |
| 200 | 208 | $modes_checksum_table = array( |
| 201 | 209 | 0x3935ea, 0x1c9af5, 0xf1b77e, 0x78dbbf, 0xc397db, 0x9e31e9, 0xb0e2f0, 0x587178, |
@@ -156,6 +156,10 @@ discard block |
||
| 156 | 156 | 't', 'u', 'v', 'w' // 119 |
| 157 | 157 | ); // char 64 |
| 158 | 158 | */ |
| 159 | + |
|
| 160 | + /** |
|
| 161 | + * @param integer $ascii |
|
| 162 | + */ |
|
| 159 | 163 | private function asciidec_2_8bit($ascii) { |
| 160 | 164 | //only process in the following range: 48-87, 96-119 |
| 161 | 165 | if ($ascii < 48) { } |
@@ -181,6 +185,10 @@ discard block |
||
| 181 | 185 | return(substr($bin, -6)); |
| 182 | 186 | } |
| 183 | 187 | |
| 188 | + /** |
|
| 189 | + * @param integer $_start |
|
| 190 | + * @param integer $_size |
|
| 191 | + */ |
|
| 184 | 192 | private function binchar($_str, $_start, $_size) { |
| 185 | 193 | // ' ' --- '?', // 0x20 - 0x3F |
| 186 | 194 | // '@' --- '_', // 0x40 - 0x5F |
@@ -206,6 +214,10 @@ discard block |
||
| 206 | 214 | } |
| 207 | 215 | |
| 208 | 216 | // function for decoding the AIS Message ITU Payload |
| 217 | + |
|
| 218 | + /** |
|
| 219 | + * @param string $_aisdata |
|
| 220 | + */ |
|
| 209 | 221 | private function decode_ais($_aisdata) { |
| 210 | 222 | $ro = new stdClass(); // return object |
| 211 | 223 | $ro->cls = 0; // AIS class undefined, also indicate unparsed msg |
@@ -378,6 +390,12 @@ discard block |
||
| 378 | 390 | else return 0; |
| 379 | 391 | } |
| 380 | 392 | |
| 393 | + /** |
|
| 394 | + * @param string $_itu |
|
| 395 | + * @param integer $_len |
|
| 396 | + * @param integer $_filler |
|
| 397 | + * @param string $aux |
|
| 398 | + */ |
|
| 381 | 399 | public function process_ais_itu($_itu, $_len, $_filler, $aux /*, $ais_ch*/) { |
| 382 | 400 | global $port; // tcpip port... |
| 383 | 401 | static $debug_counter = 0; |
@@ -397,6 +415,10 @@ discard block |
||
| 397 | 415 | |
| 398 | 416 | // char* - AIS \r terminated string |
| 399 | 417 | // TCP based streams which send messages in full can use this instead of calling process_ais_buf |
| 418 | + |
|
| 419 | + /** |
|
| 420 | + * @param string $rawdata |
|
| 421 | + */ |
|
| 400 | 422 | public function process_ais_raw($rawdata, $aux = '') { // return int |
| 401 | 423 | static $num_seq; // 1 to 9 |
| 402 | 424 | static $seq; // 1 to 9 |
@@ -622,6 +644,9 @@ discard block |
||
| 622 | 644 | return $result; |
| 623 | 645 | } |
| 624 | 646 | |
| 647 | + /** |
|
| 648 | + * @param string $mmsi |
|
| 649 | + */ |
|
| 625 | 650 | public function mmsitype($mmsi) { |
| 626 | 651 | if (strlen($mmsi) == 9) { |
| 627 | 652 | if (substr($mmsi,0,3) == '974') return 'EPIRB (Emergency Position Indicating Radio Beacon) AIS'; |