ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
GetId3\Module\Archive\Rar Class Reference

GetId3() by James Heinrich info@.nosp@m.geti.nosp@m.d3.or.nosp@m.g //. More...

+ Inheritance diagram for GetId3\Module\Archive\Rar:
+ Collaboration diagram for GetId3\Module\Archive\Rar:

Public Member Functions

 analyze ()
 
- Public Member Functions inherited from GetId3\Handler\BaseHandler
 __construct (GetId3Core $getid3, $call_module=null)
 
 analyze ()
 Analyze from file pointer. More...
 
 AnalyzeString (&$string)
 Analyze from string instead. More...
 
 saveAttachment (&$ThisFileInfoIndex, $filename, $offset, $length)
 

Data Fields

 $option_use_rar_extension = false
 

Additional Inherited Members

- Protected Member Functions inherited from GetId3\Handler\BaseHandler
 ftell ()
 
 fread ($bytes)
 
 fseek ($bytes, $whence=SEEK_SET)
 
 feof ()
 
 isDependencyFor ($module)
 
 error ($text)
 
 warning ($text)
 
- Protected Attributes inherited from GetId3\Handler\BaseHandler
 $getid3
 
 $data_string_flag = false
 
 $data_string = ''
 
 $data_string_position = 0
 
 $data_string_length = 0
 

Detailed Description

GetId3() by James Heinrich info@.nosp@m.geti.nosp@m.d3.or.nosp@m.g //.

module for analyzing RAR files

Author
James Heinrich info@.nosp@m.geti.nosp@m.d3.or.nosp@m.g http://www.getid3.org

Definition at line 29 of file Rar.php.

Member Function Documentation

◆ analyze()

GetId3\Module\Archive\Rar::analyze ( )
Returns
boolean

Reimplemented from GetId3\Handler\BaseHandler.

Definition at line 41 of file Rar.php.

42 {
43 $info = &$this->getid3->info;
44
45 $info['fileformat'] = 'rar';
46
47 if ($this->option_use_rar_extension === true) {
48 if (function_exists('rar_open')) {
49 if ($rp = rar_open($info['filenamepath'])) {
50 $info['rar']['files'] = array();
51 $entries = rar_list($rp);
52 foreach ($entries as $entry) {
53 $info['rar']['files'] = Helper::array_merge_clobber($info['rar']['files'],
54 Helper::CreateDeepArray($entry->getName(),
55 '/',
56 $entry->getUnpackedSize()));
57 }
58 rar_close($rp);
59
60 return true;
61 } else {
62 $info['error'][] = 'failed to rar_open(' . $info['filename'] . ')';
63 }
64 } else {
65 $info['error'][] = 'RAR support does not appear to be available in this PHP installation';
66 }
67 } else {
68 $info['error'][] = 'PHP-RAR processing has been disabled (set $getid3_rar->option_use_rar_extension=true to enable)';
69 }
70
71 return false;
72 }
static array_merge_clobber($array1, $array2)
Definition: Helper.php:561
static CreateDeepArray($ArrayPath, $Separator, $Value)
Definition: Helper.php:726
$info
Definition: example_052.php:80

References $info, GetId3\Lib\Helper\array_merge_clobber(), and GetId3\Lib\Helper\CreateDeepArray().

+ Here is the call graph for this function:

Field Documentation

◆ $option_use_rar_extension

GetId3\Module\Archive\Rar::$option_use_rar_extension = false

Definition at line 35 of file Rar.php.


The documentation for this class was generated from the following file: