@@ -401,6 +401,9 @@ |
||
| 401 | 401 | ///////////////////////////////////////////////////////////////// |
| 402 | 402 | |
| 403 | 403 | |
| 404 | +/** |
|
| 405 | + * @param string $string |
|
| 406 | + */ |
|
| 404 | 407 | function RemoveAccents($string) { |
| 405 | 408 | // Revised version by markstewardרotmail*com |
| 406 | 409 | // Again revised by James Heinrich (19-June-2006) |
@@ -1,6 +1,10 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | if (!function_exists('PrintHexBytes')) { |
| 4 | + |
|
| 5 | + /** |
|
| 6 | + * @param string $string |
|
| 7 | + */ |
|
| 4 | 8 | function PrintHexBytes($string) { |
| 5 | 9 | $returnstring = ''; |
| 6 | 10 | for ($i = 0; $i < strlen($string); $i++) { |
@@ -118,6 +122,10 @@ discard block |
||
| 118 | 122 | } |
| 119 | 123 | |
| 120 | 124 | if (!function_exists('fileextension')) { |
| 125 | + |
|
| 126 | + /** |
|
| 127 | + * @param string $filename |
|
| 128 | + */ |
|
| 121 | 129 | function fileextension($filename, $numextensions=1) { |
| 122 | 130 | if (strstr($filename, '.')) { |
| 123 | 131 | $reversedfilename = strrev($filename); |
@@ -135,6 +143,10 @@ discard block |
||
| 135 | 143 | } |
| 136 | 144 | |
| 137 | 145 | if (!function_exists('RemoveAccents')) { |
| 146 | + |
|
| 147 | + /** |
|
| 148 | + * @param string $string |
|
| 149 | + */ |
|
| 138 | 150 | function RemoveAccents($string) { |
| 139 | 151 | // return strtr($string, '¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ', 'SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy'); |
| 140 | 152 | // Revised version by [email protected] |
@@ -219,6 +231,10 @@ discard block |
||
| 219 | 231 | } |
| 220 | 232 | |
| 221 | 233 | if (!function_exists('DecimalBinary2Float')) { |
| 234 | + |
|
| 235 | + /** |
|
| 236 | + * @param string $binarynumerator |
|
| 237 | + */ |
|
| 222 | 238 | function DecimalBinary2Float($binarynumerator) { |
| 223 | 239 | $numerator = Bin2Dec($binarynumerator); |
| 224 | 240 | $denominator = Bin2Dec(str_repeat('1', strlen($binarynumerator))); |
@@ -227,6 +243,10 @@ discard block |
||
| 227 | 243 | } |
| 228 | 244 | |
| 229 | 245 | if (!function_exists('NormalizeBinaryPoint')) { |
| 246 | + |
|
| 247 | + /** |
|
| 248 | + * @param string $binarypointnumber |
|
| 249 | + */ |
|
| 230 | 250 | function NormalizeBinaryPoint($binarypointnumber, $maxbits=52) { |
| 231 | 251 | // http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/binary.html |
| 232 | 252 | if (strpos($binarypointnumber, '.') === false) { |
@@ -307,6 +327,10 @@ discard block |
||
| 307 | 327 | } |
| 308 | 328 | |
| 309 | 329 | if (!function_exists('BigEndian2Float')) { |
| 330 | + |
|
| 331 | + /** |
|
| 332 | + * @param string $byteword |
|
| 333 | + */ |
|
| 310 | 334 | function BigEndian2Float($byteword) { |
| 311 | 335 | // ANSI/IEEE Standard 754-1985, Standard for Binary Floating Point Arithmetic |
| 312 | 336 | // http://www.psc.edu/general/software/packages/ieee/ieee.html |
@@ -381,6 +405,10 @@ discard block |
||
| 381 | 405 | } |
| 382 | 406 | |
| 383 | 407 | if (!function_exists('BigEndian2Int')) { |
| 408 | + |
|
| 409 | + /** |
|
| 410 | + * @param string $byteword |
|
| 411 | + */ |
|
| 384 | 412 | function BigEndian2Int($byteword, $synchsafe=false, $signed=false) { |
| 385 | 413 | $intvalue = 0; |
| 386 | 414 | $bytewordlen = strlen($byteword); |
@@ -453,6 +481,10 @@ discard block |
||
| 453 | 481 | } |
| 454 | 482 | |
| 455 | 483 | if (!function_exists('Dec2Bin')) { |
| 484 | + |
|
| 485 | + /** |
|
| 486 | + * @param integer $number |
|
| 487 | + */ |
|
| 456 | 488 | function Dec2Bin($number) { |
| 457 | 489 | while ($number >= 256) { |
| 458 | 490 | $bytes[] = (($number / 256) - (floor($number / 256))) * 256; |
@@ -738,6 +770,10 @@ discard block |
||
| 738 | 770 | } |
| 739 | 771 | |
| 740 | 772 | if (!function_exists('CloseMatch')) { |
| 773 | + |
|
| 774 | + /** |
|
| 775 | + * @param integer $tolerance |
|
| 776 | + */ |
|
| 741 | 777 | function CloseMatch($value1, $value2, $tolerance) { |
| 742 | 778 | return (abs($value1 - $value2) <= $tolerance); |
| 743 | 779 | } |
@@ -2242,6 +2278,9 @@ discard block |
||
| 2242 | 2278 | return true; |
| 2243 | 2279 | } |
| 2244 | 2280 | |
| 2281 | +/** |
|
| 2282 | + * @param boolean $ScanAsCBR |
|
| 2283 | + */ |
|
| 2245 | 2284 | function RecursiveFrameScanning(&$fd, &$ThisFileInfo, &$offset, &$nextframetestoffset, $ScanAsCBR) { |
| 2246 | 2285 | for ($i = 0; $i < MPEG_VALID_CHECK_FRAMES; $i++) { |
| 2247 | 2286 | // check next MPEG_VALID_CHECK_FRAMES frames for validity, to make sure we haven't run across a false synch |
@@ -2769,6 +2808,9 @@ discard block |
||
| 2769 | 2808 | return $MPEGrawHeader; |
| 2770 | 2809 | } |
| 2771 | 2810 | |
| 2811 | +/** |
|
| 2812 | + * @param integer $padding |
|
| 2813 | + */ |
|
| 2772 | 2814 | function MPEGaudioFrameLength(&$bitrate, &$version, &$layer, $padding, &$samplerate) { |
| 2773 | 2815 | static $AudioFrameLengthCache = array(); |
| 2774 | 2816 | |
@@ -54,6 +54,9 @@ discard block |
||
| 54 | 54 | )); |
| 55 | 55 | |
| 56 | 56 | |
| 57 | +/** |
|
| 58 | + * @param string $string |
|
| 59 | + */ |
|
| 57 | 60 | function RemoveAccents($string) { |
| 58 | 61 | // Revised version by markstewardØhotmail*com |
| 59 | 62 | return strtr(strtr($string, 'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝàáâãäåçèéêëìíîïñòóôõöøùúûüýÿ', 'SZszYAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy'), array('Þ' => 'TH', 'þ' => 'th', 'Ð' => 'DH', 'ð' => 'dh', 'ß' => 'ss', '' => 'OE', '' => 'oe', 'Æ' => 'AE', 'æ' => 'ae', 'µ' => 'u')); |
@@ -81,6 +84,9 @@ discard block |
||
| 81 | 84 | return '<span style="color: #'.BitrateColor($bitrate).'">'.number_format($bitrate, $decimals).' kbps</span>'; |
| 82 | 85 | } |
| 83 | 86 | |
| 87 | +/** |
|
| 88 | + * @param string $filename |
|
| 89 | + */ |
|
| 84 | 90 | function fileextension($filename, $numextensions=1) { |
| 85 | 91 | if (strstr($filename, '.')) { |
| 86 | 92 | $reversedfilename = strrev($filename); |
@@ -152,6 +158,9 @@ discard block |
||
| 152 | 158 | return $filename; |
| 153 | 159 | } |
| 154 | 160 | |
| 161 | +/** |
|
| 162 | + * @param string $SQLquery |
|
| 163 | + */ |
|
| 155 | 164 | function mysql_query_safe($SQLquery) { |
| 156 | 165 | static $TimeSpentQuerying = 0; |
| 157 | 166 | if ($SQLquery === null) { |
@@ -2095,6 +2104,9 @@ discard block |
||
| 2095 | 2104 | return $DirectoryName.'/'.BetterUCwords($BaseFilename).'.'.strtolower($FileExtension); |
| 2096 | 2105 | } |
| 2097 | 2106 | |
| 2107 | +/** |
|
| 2108 | + * @param string $string |
|
| 2109 | + */ |
|
| 2098 | 2110 | function BetterUCwords($string) { |
| 2099 | 2111 | $stringlength = strlen($string); |
| 2100 | 2112 | |
@@ -94,7 +94,7 @@ |
||
| 94 | 94 | /** |
| 95 | 95 | * __construct() |
| 96 | 96 | * @param string $table holds name of sqlite table |
| 97 | - * @return type |
|
| 97 | + * @return boolean |
|
| 98 | 98 | */ |
| 99 | 99 | public function __construct($table='getid3_cache', $hide=false) { |
| 100 | 100 | $this->table = $table; // Set table |
@@ -1124,6 +1124,9 @@ discard block |
||
| 1124 | 1124 | |
| 1125 | 1125 | |
| 1126 | 1126 | |
| 1127 | + /** |
|
| 1128 | + * @param string $filedata |
|
| 1129 | + */ |
|
| 1127 | 1130 | public function GetFileFormat(&$filedata, $filename='') { |
| 1128 | 1131 | // this function will determine the format of a file based on usually |
| 1129 | 1132 | // the first 2-4 bytes of the file (8 bytes for PNG, 16 bytes for JPG, |
@@ -1308,6 +1311,9 @@ discard block |
||
| 1308 | 1311 | return true; |
| 1309 | 1312 | } |
| 1310 | 1313 | |
| 1314 | + /** |
|
| 1315 | + * @param string $algorithm |
|
| 1316 | + */ |
|
| 1311 | 1317 | public function getHashdata($algorithm) { |
| 1312 | 1318 | switch ($algorithm) { |
| 1313 | 1319 | case 'md5': |
@@ -1601,6 +1607,9 @@ discard block |
||
| 1601 | 1607 | return tempnam($this->tempdir, 'gI3'); |
| 1602 | 1608 | } |
| 1603 | 1609 | |
| 1610 | + /** |
|
| 1611 | + * @param string $name |
|
| 1612 | + */ |
|
| 1604 | 1613 | public function include_module($name) { |
| 1605 | 1614 | //if (!file_exists($this->include_path.'module.'.$name.'.php')) { |
| 1606 | 1615 | if (!file_exists(GETID3_INCLUDEPATH.'module.'.$name.'.php')) { |
@@ -1628,6 +1637,9 @@ discard block |
||
| 1628 | 1637 | private $dependency_to = null; |
| 1629 | 1638 | |
| 1630 | 1639 | |
| 1640 | + /** |
|
| 1641 | + * @param string $call_module |
|
| 1642 | + */ |
|
| 1631 | 1643 | public function __construct(getID3 $getid3, $call_module=null) { |
| 1632 | 1644 | $this->getid3 = $getid3; |
| 1633 | 1645 | |
@@ -1708,6 +1720,9 @@ discard block |
||
| 1708 | 1720 | return $contents; |
| 1709 | 1721 | } |
| 1710 | 1722 | |
| 1723 | + /** |
|
| 1724 | + * @param integer $whence |
|
| 1725 | + */ |
|
| 1711 | 1726 | protected function fseek($bytes, $whence=SEEK_SET) { |
| 1712 | 1727 | if ($this->data_string_flag) { |
| 1713 | 1728 | switch ($whence) { |
@@ -1745,10 +1760,16 @@ discard block |
||
| 1745 | 1760 | return feof($this->getid3->fp); |
| 1746 | 1761 | } |
| 1747 | 1762 | |
| 1763 | + /** |
|
| 1764 | + * @param string $module |
|
| 1765 | + */ |
|
| 1748 | 1766 | final protected function isDependencyFor($module) { |
| 1749 | 1767 | return $this->dependency_to == $module; |
| 1750 | 1768 | } |
| 1751 | 1769 | |
| 1770 | + /** |
|
| 1771 | + * @param string $text |
|
| 1772 | + */ |
|
| 1752 | 1773 | protected function error($text) { |
| 1753 | 1774 | $this->getid3->info['error'][] = $text; |
| 1754 | 1775 | |
@@ -1759,6 +1780,9 @@ discard block |
||
| 1759 | 1780 | return $this->getid3->warning($text); |
| 1760 | 1781 | } |
| 1761 | 1782 | |
| 1783 | + /** |
|
| 1784 | + * @param string $text |
|
| 1785 | + */ |
|
| 1762 | 1786 | protected function notice($text) { |
| 1763 | 1787 | // does nothing for now |
| 1764 | 1788 | } |
@@ -153,6 +153,10 @@ |
||
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | // Converts the file type |
| 156 | + |
|
| 157 | + /** |
|
| 158 | + * @param string $typflag |
|
| 159 | + */ |
|
| 156 | 160 | public function get_flag_type($typflag) { |
| 157 | 161 | static $flag_types = array( |
| 158 | 162 | '0' => 'LF_NORMAL', |
@@ -426,6 +426,9 @@ |
||
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | |
| 429 | + /** |
|
| 430 | + * @param integer $index |
|
| 431 | + */ |
|
| 429 | 432 | public static function ZIPversionOSLookup($index) { |
| 430 | 433 | static $ZIPversionOSLookup = array( |
| 431 | 434 | 0 => 'MS-DOS and OS/2 (FAT / VFAT / FAT32 file systems)', |
@@ -1684,6 +1684,10 @@ |
||
| 1684 | 1684 | return (isset($lookup[$WMpictureType]) ? $lookup[$WMpictureType] : ''); |
| 1685 | 1685 | } |
| 1686 | 1686 | |
| 1687 | + /** |
|
| 1688 | + * @param string $asf_header_extension_object_data |
|
| 1689 | + * @param integer $unhandled_sections |
|
| 1690 | + */ |
|
| 1687 | 1691 | public function HeaderExtensionObjectDataParse(&$asf_header_extension_object_data, &$unhandled_sections) { |
| 1688 | 1692 | // http://msdn.microsoft.com/en-us/library/bb643323.aspx |
| 1689 | 1693 | |
@@ -390,6 +390,9 @@ discard block |
||
| 390 | 390 | public $bytes; |
| 391 | 391 | public $pos; |
| 392 | 392 | |
| 393 | + /** |
|
| 394 | + * @param string $bytes |
|
| 395 | + */ |
|
| 393 | 396 | public function __construct(&$bytes) { |
| 394 | 397 | $this->bytes =& $bytes; |
| 395 | 398 | $this->pos = 0; |
@@ -473,6 +476,9 @@ discard block |
||
| 473 | 476 | class AMFReader { |
| 474 | 477 | public $stream; |
| 475 | 478 | |
| 479 | + /** |
|
| 480 | + * @param AMFStream $stream |
|
| 481 | + */ |
|
| 476 | 482 | public function __construct(&$stream) { |
| 477 | 483 | $this->stream =& $stream; |
| 478 | 484 | } |
@@ -635,6 +641,9 @@ discard block |
||
| 635 | 641 | public $width; |
| 636 | 642 | public $height; |
| 637 | 643 | |
| 644 | + /** |
|
| 645 | + * @param string $sps |
|
| 646 | + */ |
|
| 638 | 647 | public function __construct($sps) { |
| 639 | 648 | $this->sps = $sps; |
| 640 | 649 | } |
@@ -691,6 +700,9 @@ discard block |
||
| 691 | 700 | } |
| 692 | 701 | } |
| 693 | 702 | |
| 703 | + /** |
|
| 704 | + * @param integer $bits |
|
| 705 | + */ |
|
| 694 | 706 | public function skipBits($bits) { |
| 695 | 707 | $newBits = $this->currentBits + $bits; |
| 696 | 708 | $this->currentBytes += (int)floor($newBits / 8); |
@@ -703,6 +715,9 @@ discard block |
||
| 703 | 715 | return $result; |
| 704 | 716 | } |
| 705 | 717 | |
| 718 | + /** |
|
| 719 | + * @param integer $bits |
|
| 720 | + */ |
|
| 706 | 721 | public function getBits($bits) { |
| 707 | 722 | $result = 0; |
| 708 | 723 | for ($i = 0; $i < $bits; $i++) { |