MediaWiki REL1_40
MSCompoundFileReader Class Reference

Read the directory of a Microsoft Compound File Binary file, a.k.a. More...

Static Public Member Functions

static readFile ( $fileName)
 Read a file by name.
 
static readHandle ( $fileHandle)
 Read from an open seekable handle.
 

Public Attributes

const ERROR_FILE_OPEN = 1
 
const ERROR_INVALID_FORMAT = 6
 
const ERROR_INVALID_SIGNATURE = 4
 
const ERROR_READ = 3
 
const ERROR_READ_PAST_END = 5
 
const ERROR_SEEK = 2
 

Detailed Description

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 34 of file MSCompoundFileReader.php.

Member Function Documentation

◆ readFile()

static MSCompoundFileReader::readFile ( $fileName)
static

Read a file by name.

Parameters
string$fileNameThe 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 79 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
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 103 of file MSCompoundFileReader.php.

Referenced by readFile().

Member Data Documentation

◆ ERROR_FILE_OPEN

const MSCompoundFileReader::ERROR_FILE_OPEN = 1

Definition at line 52 of file MSCompoundFileReader.php.

Referenced by readFile().

◆ ERROR_INVALID_FORMAT

const MSCompoundFileReader::ERROR_INVALID_FORMAT = 6

Definition at line 57 of file MSCompoundFileReader.php.

◆ ERROR_INVALID_SIGNATURE

const MSCompoundFileReader::ERROR_INVALID_SIGNATURE = 4

Definition at line 55 of file MSCompoundFileReader.php.

◆ ERROR_READ

const MSCompoundFileReader::ERROR_READ = 3

Definition at line 54 of file MSCompoundFileReader.php.

◆ ERROR_READ_PAST_END

const MSCompoundFileReader::ERROR_READ_PAST_END = 5

Definition at line 56 of file MSCompoundFileReader.php.

◆ ERROR_SEEK

const MSCompoundFileReader::ERROR_SEEK = 2

Definition at line 53 of file MSCompoundFileReader.php.


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