ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
Msoffice.php
Go to the documentation of this file.
1<?php
2
3namespace GetId3\Module\Misc;
4
7
10// available at http://getid3.sourceforge.net //
11// or http://www.getid3.org //
13// See readme.txt for more details //
15// //
16// module.archive.doc.php //
17// module for analyzing MS Office (.doc, .xls, etc) files //
18// dependencies: NONE //
19// ///
21
29class Msoffice extends BaseHandler
30{
31
36 public function analyze()
37 {
38 $info = &$this->getid3->info;
39
40 fseek($this->getid3->fp, $info['avdataoffset'], SEEK_SET);
41 $DOCFILEheader = fread($this->getid3->fp, 8);
42 $magic = "\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1";
43 if (substr($DOCFILEheader, 0, 8) != $magic) {
44 $info['error'][] = 'Expecting "'.Helper::PrintHexBytes($magic).'" at '.$info['avdataoffset'].', found '.Helper::PrintHexBytes(substr($DOCFILEheader, 0, 8)).' instead.';
45
46 return false;
47 }
48 $info['fileformat'] = 'msoffice';
49
50$info['error'][] = 'MS Office (.doc, .xls, etc) parsing not enabled in this version of GetId3Core() ['.$this->getid3->version().']';
51return false;
52
53 }
54
55}
An exception for terminatinating execution or to throw for unit testing.
GetId3() by James Heinrich info@getid3.org //.
Definition: BaseHandler.php:26
fseek($bytes, $whence=SEEK_SET)
GetId3() by James Heinrich info@getid3.org //.
Definition: Helper.php:27
static PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8')
Definition: Helper.php:36
GetId3() by James Heinrich info@getid3.org //.
Definition: Msoffice.php:30
$info
Definition: example_052.php:80