<?php
+
/////////////////////////////////////////////////////////////////
/// getID3() by James Heinrich <info@getid3.org> //
-// available at http://getid3.sourceforge.net //
-// or http://www.getid3.org //
-// also https://github.com/JamesHeinrich/getID3 //
-/////////////////////////////////////////////////////////////////
-// See readme.txt for more details //
+// available at https://github.com/JamesHeinrich/getID3 //
+// or https://www.getid3.org //
+// or http://getid3.sourceforge.net //
+// see readme.txt for more details //
/////////////////////////////////////////////////////////////////
// //
// module.archive.gzip.php //
/////////////////////////////////////////////////////////////////
-class getid3_gzip extends getid3_handler {
-
- // public: Optional file list - disable for speed.
- public $option_gzip_parse_contents = false; // decode gzipped files, if possible, and parse recursively (.tar.gz for example)
+class getid3_gzip extends getid3_handler
+{
+ /**
+ * Optional file list - disable for speed.
+ *
+ * Decode gzipped files, if possible, and parse recursively (.tar.gz for example).
+ *
+ * @var bool
+ */
+ public $option_gzip_parse_contents = false;
+ /**
+ * @return bool
+ */
public function Analyze() {
$info = &$this->getid3->info;
$buffer = $this->fread($info['filesize']);
$arr_members = explode("\x1F\x8B\x08", $buffer);
+ $num_members = 0;
while (true) {
$is_wrong_members = false;
$num_members = intval(count($arr_members));
$inflated = gzinflate($cdata);
// Calculate CRC32 for inflated content
- $thisInfo['crc32_valid'] = (bool) (sprintf('%u', crc32($inflated)) == $thisInfo['crc32']);
+ $thisInfo['crc32_valid'] = sprintf('%u', crc32($inflated)) == $thisInfo['crc32'];
// determine format
$formattest = substr($inflated, 0, 32774);
// unknown or unhandled format
break;
}
+ } else {
+ $this->warning('PHP is not compiled with gzinflate() support. Please enable PHP Zlib extension or recompile with the --with-zlib switch');
}
}
}
return true;
}
- // Converts the OS type
+ /**
+ * Converts the OS type.
+ *
+ * @param string $key
+ *
+ * @return string
+ */
public function get_os_type($key) {
static $os_type = array(
'0' => 'FAT filesystem (MS-DOS, OS/2, NT/Win32)',
return (isset($os_type[$key]) ? $os_type[$key] : '');
}
- // Converts the eXtra FLags
+ /**
+ * Converts the eXtra FLags.
+ *
+ * @param string $key
+ *
+ * @return string
+ */
public function get_xflag_type($key) {
static $xflag_type = array(
'0' => 'unknown',