ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
module.archive.rar.php
Go to the documentation of this file.
1<?php
4// available at http://getid3.sourceforge.net //
5// or http://www.getid3.org //
6// also https://github.com/JamesHeinrich/getID3 //
8// See readme.txt for more details //
10// //
11// module.archive.rar.php //
12// module for analyzing RAR files //
13// dependencies: NONE //
14// ///
16
17
19{
20
22
23 public function Analyze() {
24 $info = &$this->getid3->info;
25
26 $info['fileformat'] = 'rar';
27
28 if ($this->option_use_rar_extension === true) {
29 if (function_exists('rar_open')) {
30 if ($rp = rar_open($info['filenamepath'])) {
31 $info['rar']['files'] = array();
32 $entries = rar_list($rp);
33 foreach ($entries as $entry) {
34 $info['rar']['files'] = getid3_lib::array_merge_clobber($info['rar']['files'], getid3_lib::CreateDeepArray($entry->getName(), '/', $entry->getUnpackedSize()));
35 }
36 rar_close($rp);
37 return true;
38 } else {
39 $this->error('failed to rar_open('.$info['filename'].')');
40 }
41 } else {
42 $this->error('RAR support does not appear to be available in this PHP installation');
43 }
44 } else {
45 $this->error('PHP-RAR processing has been disabled (set $getid3_rar->option_use_rar_extension=true to enable)');
46 }
47 return false;
48
49 }
50
51}
An exception for terminatinating execution or to throw for unit testing.
error($text)
Definition: getid3.php:1752
static CreateDeepArray($ArrayPath, $Separator, $Value)
Definition: getid3.lib.php:491
static array_merge_clobber($array1, $array2)
Definition: getid3.lib.php:384
getID3() by James Heinrich info@getid3.org //
$info
Definition: index.php:5