Read the directory of a Microsoft Compound File Binary file, a.k.a.
More...
|
static | readFile ( $fileName) |
| Read a file by name.
|
|
static | readHandle ( $fileHandle) |
| Read from an open seekable handle.
|
|
Read the directory of a Microsoft Compound File Binary file, a.k.a.
an OLE file, and detect the MIME type.
References:
- Since
- 1.33
Definition at line 32 of file MSCompoundFileReader.php.
◆ __construct()
MSCompoundFileReader::__construct |
( |
|
$fileHandle | ) |
|
|
private |
◆ bin2dec()
MSCompoundFileReader::bin2dec |
( |
|
$str, |
|
|
|
$offset, |
|
|
|
$length |
|
) |
| |
|
private |
◆ decodeClsid()
MSCompoundFileReader::decodeClsid |
( |
|
$binaryClsid | ) |
|
|
private |
◆ error()
MSCompoundFileReader::error |
( |
|
$message, |
|
|
|
$code |
|
) |
| |
|
private |
◆ fseek()
MSCompoundFileReader::fseek |
( |
|
$offset | ) |
|
|
private |
◆ getFatSector()
MSCompoundFileReader::getFatSector |
( |
|
$fatSectorId | ) |
|
|
private |
◆ getNextSectorIdFromFat()
MSCompoundFileReader::getNextSectorIdFromFat |
( |
|
$sectorId | ) |
|
|
private |
◆ init()
MSCompoundFileReader::init |
( |
| ) |
|
|
private |
◆ readDifat()
MSCompoundFileReader::readDifat |
( |
| ) |
|
|
private |
◆ readDirectory()
MSCompoundFileReader::readDirectory |
( |
| ) |
|
|
private |
◆ readFile()
static MSCompoundFileReader::readFile |
( |
|
$fileName | ) |
|
|
static |
Read a file by name.
- Parameters
-
string | $fileName | The full path to the file |
- Returns
- array An associative array of information about the file:
- valid: true if the file is valid, false otherwise
- error: An error message in English, should be present if valid=false
- errorCode: One of the self::ERROR_* constants
- mime: The MIME type detected from the directory contents
- mimeFromClsid: The MIME type detected from the CLSID on the root directory entry
Definition at line 77 of file MSCompoundFileReader.php.
References ERROR_FILE_OPEN, and readHandle().
◆ readHandle()
static MSCompoundFileReader::readHandle |
( |
|
$fileHandle | ) |
|
|
static |
Read from an open seekable handle.
- Parameters
-
resource | $fileHandle | The file handle |
- Returns
- array An associative array of information about the file:
- valid: true if the file is valid, false otherwise
- error: An error message in English, should be present if valid=false
- errorCode: One of the self::ERROR_* constants
- mime: The MIME type detected from the directory contents
- mimeFromClsid: The MIME type detected from the CLSID on the root directory entry
Definition at line 101 of file MSCompoundFileReader.php.
Referenced by readFile().
◆ readOffset()
MSCompoundFileReader::readOffset |
( |
|
$offset, |
|
|
|
$length |
|
) |
| |
|
private |
◆ readSector()
MSCompoundFileReader::readSector |
( |
|
$sectorId | ) |
|
|
private |
◆ sectorOffset()
MSCompoundFileReader::sectorOffset |
( |
|
$sectorId | ) |
|
|
private |
◆ unpack()
MSCompoundFileReader::unpack |
( |
|
$block, |
|
|
|
$offset, |
|
|
|
$struct |
|
) |
| |
|
private |
◆ unpackOffset()
MSCompoundFileReader::unpackOffset |
( |
|
$offset, |
|
|
|
$struct |
|
) |
| |
|
private |
◆ $difat
MSCompoundFileReader::$difat |
|
private |
◆ $error
MSCompoundFileReader::$error |
|
private |
◆ $errorCode
MSCompoundFileReader::$errorCode |
|
private |
◆ $fat
MSCompoundFileReader::$fat = [] |
|
private |
◆ $file
MSCompoundFileReader::$file |
|
private |
◆ $header
MSCompoundFileReader::$header |
|
private |
◆ $mime
MSCompoundFileReader::$mime |
|
private |
◆ $mimeFromClsid
MSCompoundFileReader::$mimeFromClsid |
|
private |
◆ $mimesByClsid
MSCompoundFileReader::$mimesByClsid |
|
staticprivate |
Initial value:= [
'00020810-0000-0000-C000-000000000046' => 'application/vnd.ms-excel',
'00020820-0000-0000-C000-000000000046' => 'application/vnd.ms-excel',
'00020906-0000-0000-C000-000000000046' => 'application/msword',
'64818D10-4F9B-11CF-86EA-00AA00B929E8' => 'application/vnd.ms-powerpoint',
]
Definition at line 57 of file MSCompoundFileReader.php.
◆ $sectorLength
MSCompoundFileReader::$sectorLength |
|
private |
◆ $valid
MSCompoundFileReader::$valid = false |
|
private |
◆ ERROR_FILE_OPEN
const MSCompoundFileReader::ERROR_FILE_OPEN = 1 |
◆ ERROR_INVALID_FORMAT
const MSCompoundFileReader::ERROR_INVALID_FORMAT = 6 |
◆ ERROR_INVALID_SIGNATURE
const MSCompoundFileReader::ERROR_INVALID_SIGNATURE = 4 |
◆ ERROR_READ
const MSCompoundFileReader::ERROR_READ = 3 |
◆ ERROR_READ_PAST_END
const MSCompoundFileReader::ERROR_READ_PAST_END = 5 |
◆ ERROR_SEEK
const MSCompoundFileReader::ERROR_SEEK = 2 |
◆ TYPE_ROOT
const MSCompoundFileReader::TYPE_ROOT = 5 |
|
private |
◆ TYPE_STORAGE
const MSCompoundFileReader::TYPE_STORAGE = 1 |
|
private |
◆ TYPE_STREAM
const MSCompoundFileReader::TYPE_STREAM = 2 |
|
private |
◆ TYPE_UNALLOCATED
const MSCompoundFileReader::TYPE_UNALLOCATED = 0 |
|
private |
The documentation for this class was generated from the following file: